//判断结束日期是否小于起始日期
protected function finalDate_focusOutHandler(event:FocusEvent):void
{
if(ObjectUtil.dateCompare(DateField.stringToDate(finalDate.text,"YYYY-MM-DD"),DateField.stringToDate(startDate.text,"YYYY-MM-DD")) == -1){
Alert.show( "结束日期不能小于起始日期");
finalDate.text = startDate.text;
}
}
//判断起始日期是否大于结束日期
protected function startDate_focusOutHandler(event:FocusEvent):void
{
if(ObjectUtil.dateCompare(DateField.stringToDate(startDate.text,"YYYY-MM-DD"),DateField.stringToDate(finalDate.text,"YYYY-MM-DD")) == 1){
Alert.show("起始日期不能大于结束日期");
startDate.text = finalDate.text;
}
}
转载于:https://www.cnblogs.com/programmer-wind/archive/2012/07/04/2919634.html