on 01-12-2007 1:45 PM
Hi,
I'm using a DateNavigator to choose a range of dates which I want to add to context. How can I add a range of dates to context value attributes? Also the lenght of the selected range may vary.
Regards
Øyvind
Hi Guys,
Why are you using two Date Navigators for selecting a date range? You can, instead use one date navigator and set selectionMode property to range. Other values you can get from the properties of the dateNavigator UI; firstSelectedDate and lastSelectedDate.
Regards,
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
you dont think about the logic..The logic is already built in it..U just need to substract one from the end date to first date or opposite...
you will get the exact dates between those..
Regards
AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do u mean to say , the context has to be created dynamically...There are many blogs to create elemnts dynamically...
if that is not necessary to add as many datecontext as the date range, i will suggest you an another solution..check if it helps..
date firstdt = wdCon.......getFirstSelDate
date scedt = wdco..........getLastSelDate
if you want the date range secdt.getDate-firstDt.getDate
if you want the dates inbetween these two days, you can build up logic by minusing one till the firstSelected date.
Regards
AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
yes, I want the dates between these two days. But I do not think it is a good solution if I have to build up my own logic by minusing one till the firstSelected date. As I said in my previous reply, this may be problematic when the dates are in two different months, and also take into account years with 366 days...
I think my solution is to add each date one by one, by using a button with its own action to put the chosen date into a context variable.
Regs
Øyvind
Hi
What a problem here? Use two date navigators, one for start date, second - for end date. Create two attributes of Date type in context. Then you can substract first date from the second one and get range in milliseconds.
BR
Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok I can do that, and just calculate how many days this is. But I thought it was an easier way to do this in wd using the datenavigator, because I still have to do some programming to handle for instance a date range from different months (varies from 28 days to 31 days). The point is I want to have one context variable for each day in the selected date range.
Regs
Øyvind
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.