1 Reply Latest reply on Dec 23, 2008 6:50 AM by Newsgroup_User

    Date field issue

    mywork888
      I am not sure if it is only me. I have try this serveral times with date field component.

      Here is my code:

      <mx:Script>
      <![CDATA[
      private function init():void
      {
      text1.text = dateField.selectedDate.fullYear
      + "/" + dateField.selectedDate.month + "/" + dateField.selectedDate.date;
      }
      ]]>
      </mx:Script>

      <mx:Text id="text1" />

      <mx:DateField id="dateField" close="init();" formatString="YYYY/MM/DD"/>

      after the date field closed, the text show the right YEAR and DATE, but not the right MONTH. If I choose January, the MONTH will actually becomes to ZERO.

      Please, could anyone tell me why!

      Thank you so much.

      Have a good festive season.
        • 1. Re: Date field issue
          Level 7

          "mywork888" <webforumsuser@macromedia.com> wrote in message
          news:giqbu2$f9c$1@forums.macromedia.com...
          >I am not sure if it is only me. I have try this serveral times with date
          >field
          > component.
          >
          > Here is my code:
          >
          > <mx:Script>
          > <![CDATA[
          > private function init():void
          > {
          > text1.text = dateField.selectedDate.fullYear
          > + "/" + dateField.selectedDate.month + "/" + dateField.selectedDate.date;
          > }
          > ]]>
          > </mx:Script>
          >
          > <mx:Text id="text1" />
          >
          > <mx:DateField id="dateField" close="init();" formatString="YYYY/MM/DD"/>
          >
          > after the date field closed, the text show the right YEAR and DATE, but
          > not
          > the right MONTH. If I choose January, the MONTH will actually becomes to
          > ZERO.

          That's right. The months are zero based.