1 Reply Latest reply on Apr 2, 2010 6:23 AM by TanweerHq

    datepicker

    cancertropica100

      HI to all friends out there. I am working on datepicker control. I need to display dates which are coming from xml as attribute and display some text on those particular date. Those date which  are in xml must be heighlighted in calender with some color and having some value below the  that particular date. The text which i need to show is also in same element where date is one attribute.


      So please tell me how i can achieve his task.if possible show me with example .


      Thank you in advance.

        • 1. Re: datepicker
          TanweerHq Level 2

          Hope this will help you -

           

          <mx:Script>

           

                  <![CDATA[

           

                      private function onInitialize():void {

           

                          dc1.displayedMonth = 3;

           

                          dc1.displayedYear = 2010;

           

                      }          

           

                     

           

                      public function displayDates():void {

           

                          var dateRanges:Array = [];

           

                          for (var i:int=0; i<shows.show.length(); i++) {

           

                              var cDate:Date =

           

                                  new Date(shows.show[i].showDate.toString());          

           

                              var cDateObject:Object =

           

                                  {rangeStart:cDate, rangeEnd:cDate};

           

                              dateRanges.push(cDateObject);

           

                          }

           

                          dc1.selectedRanges = dateRanges;

           

                      }          

           

                  ]]>

           

              </mx:Script>

           

           

              <mx:XML id="shows" format="e4x">

           

               <data>

           

                  <show>

           

                   <showID>1</showID>

           

                   <showDate>04/15/2010</showDate>

           

                   <showTime>10:00am/11:00am</showTime>

           

                  </show>

           

                  <show>

           

                   <showID>2</showID>

           

                   <showDate>04/20/2010</showDate>

           

                   <showTime>7:00pm</showTime>

           

                  </show>

           

               </data>

           

              </mx:XML>

           

           

              <mx:DateChooser id="dc1"

           

                  showToday="false"

           

                  creationComplete="displayDates()"

           

              />