3 Replies Latest reply on Jan 26, 2009 3:32 AM by amthekkel


      Hello. I need to select some days in a DateChooser, for example, Monday and Wednesday, on a range of days. In others words: is it posible, for example, that a datchooser autoselect (change the color or somthing like that) monday and wednesday since 01/01/2009 to 01/25/2008?
        • 1. Re: DateChooser
          atta707 Level 2
          Take a look at the following properties for the DateChooser component:


          at http://livedocs.adobe.com/flex/3/langref/mx/controls/DateChooser.html
          • 2. Re: DateChooser
            Arielb85 Level 1
            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?
            • 3. Re: DateChooser
              amthekkel Level 1
              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.