This content has been marked as final. Show 3 replies
Take a look at the following properties for the DateChooser component:
Thanks!! But how can I know what day of the week is an specific date?
For example I want to know if "01/01/2009" is Monday or Wednesday. is it posible?
to know what day of the week a specific date is, get the Date.Day property. This returns the day of the week as a number i.e sunday as 0,Monday as 1, Tuesday as 2 and so on..
For your problem, I would think that create two date objects representing the end points of the date range. Create another date object, create a loop where the third object is greater than the rangestart date and less than the range end date.
Within the loop, increment the date by adding a day to the thrid date object using the Date.Date property.
e.g. Date d=new Date(); // Lets say this is the third date object
to add a day you can do d.date=d.date+1;
i have had problems with dates before so for if the above doesn't work you might try
Date d=new date();
d=new Date(d.fullYear,d.month,d.date=1); //this line should be in the loop
Once you increment the date, you can check the d.day property using an if loop to see if it is monday or tuesday
and then do your code for setting the date of the datefield.