1 Reply Latest reply on Mar 14, 2008 9:25 PM by Sreenivas R

    DateField disabledRange attribute setting?

    mark416 Level 1

      I need limited the selected date in datafield to current year.

      I have a question for the feature.It works fine when I use MXML tage attribute settings.

      But it doesn't work when I return the Array from a function. I need get current year in
      a function and return a array.

      The following code works fine

      <mx:DateField x="160" y="159" disabledRanges = "{[{rangeEnd: new
      Date(2007,11,31)},{rangeStart: new Date(2008,12,1)}]}" />

      But the following code doesn't work, the function return an Array, I
      am not sure if the Array format is ok or not.


      private var dataRang:Array;

      private function disRange():Array{

      dataRang =new Array("{rangeEnd: new
      Date(2007,11,31)}","{rangeStart: new Date(2008,12,1)}");
      return dataRang;

      <mx:DateField x="160" y="129" disabledRanges = "{disRange()}" />

      <mx:DateField x="160" y="129" disabledRanges = "{[disRange()]}" />

      Please give me a help.