Thursday, June 7, 2012

Setting all the dates before today as unsetectable in Date Field

If you want to have a date field where user is allowed to only select either today or any date after today you will have to use the disabledRanges property of Date filed like being used in the example below

<mx:DateField id="startDateForRAC" yearNavigationEnabled="true"
                    change="dateChanged(DateField("  width="91"
                     disabledRanges="{[ {rangeEnd: new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-1)} ]}"
                    selectedDate="{new Date(today.getFullYear(), today.getMonth(), today.getDate())}" />

Note that only rangeEnd will be used to have a similar date field.

No comments:

Post a Comment