0 Replies Latest reply on Jun 5, 2007 8:19 AM by raj1399

    datefield month year


      I have noticed that if you select some date in the datefield which is not the current date.
      And then on any other event of any component if you use the displayedmonth and displayedyear of the datefiled to the current month and year.
      Then the current month and year is not shown in the datechooser attached with the datefield.

      Is this a bug?

      I have the following piece of the code .

      Steps to reproduce problem.

      1.Select any date other than the today date in the datefield.(select previous month and year)
      2.Click the button.
      3.Open the datechooser . It doesn't show the current month and year.

      Expected result.
      Datechooser should show the current month and year.

      Actual Result:
      Datechooser shows the selected month and year.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:DateField id="fromDateField" showToday="true" width="100" yearNavigationEnabled="true" editable="true" top="263" left="43" />
      <mx:Button x="60" y="293" label="Button" click="changeselMonth()"/>
      import mx.controls.Alert;
      public function changeselMonth()
      //fromDateField.selectedDate = null;
      //fromDateField.showToday = true;
      //fromDateField.selectedDate = new Date();
      //fromDateField.text = "";
      //mx.controls.Alert.show( " fromDateField.displayedMonth " + fromDateField.displayedMonth
      //+ " fromDateField.displayedYear " + fromDateField.displayedYear);
      fromDateField.selectedDate = null;
      //fromDateField.displayedMonth = 8;
      //fromDateField.displayedYear = 2006;

      var selMonth:int = int(new Date().getMonth());
      var selYear:int = int(new Date().getFullYear());
      fromDateField.displayedMonth = selMonth;
      fromDateField.displayedYear = selYear;