0 Replies Latest reply on Sep 5, 2007 5:07 AM by rabbit2b

    dateField problem on flex

    rabbit2b
      Hi All,

      I have a problem with displaying the date in a inputText. Eveything works fine but the "DAY" of the date is displayed wrong.
      What is the problem my code is below.

      <mx:DateField x="30" y="60" id="curDate" disabledRanges="{[ {rangeEnd: new Date(2007, 1, 1)} ]}"/>
      <mx:Button x="171" y="60" click="{ getDate(); }" label="Add Note" id="activateButton"/>

      private function getDate():void {

      if(curDate.selectedDate == null) {
      Alert.show("No Date Selected !");
      }

      else {

      var myDay:Number = curDate.selectedDate.getDay();
      var myMonth:Number = (curDate.selectedDate.getMonth())+1;
      var myYear:Number = curDate.selectedDate.getFullYear();
      var myDate:String = myDay.toString() + "/" + myMonth.toString() + "/" + myYear.toString();

      myPanel.visible=true;
      cancelOp.enabled=true;
      dateText.text = myDate;
      }
      }