DateUtils is a helper class with a lot of static methods to handle dates.
public static function dateAdd(date:Date, mask:String, addValue:int):Date
Adds given values to a date, using a mask. The mask parameter can take the following values :
- d : Days.
- m : Months.
- y : Years.
Parameters
| date:Date — The date to add value to.
|
| |
| mask:String — The mask to apply on addition.
|
| |
| addValue:int — The value to add. Can be negative.
|
Returns
public static function dateAddOpenDatesOnly(date:Date, daysToAdd:int):Date
Adds days to a given date, including only open dates.
Parameters
| date:Date — The date.
|
| |
| daysToAdd:int — The number of days to add. Can be negative.
|
Returns
public static function dateComparator(obj1:Date, obj2:Date):Number
Dates comparator function.
Parameters
Returns
| Number — a negative value if obj1 < obj2, zero is obj1 == obj2, a positive value is obj1 > obj2.
|
public static function dateCopy(date:Date):Date
Creates a fresh new clone of the passed date.
Parameters
| date:Date — The date to copy.
|
Returns
| Date — A new Date, clone of an existing one.
|
public static function dateDiff(date1:Date, date2:Date, mask:String):Number
Returns the difference between to dates, with the parameter mask as the unit. The mask parameter can take the following values :
- d : Days.
- m : Months.
- y : Years.
The method do not consider hours, minutes, seconds and milliseconds.
Parameters
| date1:Date — The first operand.
|
| |
| date2:Date — The second operand.
|
| |
| mask:String — The unit to use.
|
Returns
| Number — The difference ( date1 - date2).
|
public static function getCurrentDate():Date
Returns the current date, with hh:mm:ss-ms set to 00:00:00-000.
Returns
public static function getLastDayInMonth(fullYear:int, month:int):int
Returns the last day for a given month and year.
Parameters
| fullYear:int — The year.
|
| |
| month:int — The month. (0-11)
|
Returns
| int — The last day in month.
|
public static function getMidnightDateCopy(date:Date):Date
Returns the copy of a date, with the time set to 00:00:00-000.
Parameters
| date:Date — The date to copy.
|
Returns
public static function getSeparatorsOff(value:String):String
Used to return a date typed in without any separators
Parameters
Returns
public static function isOpenDate(date:Date):Boolean
Checks if a date is an open date (excluding saturday/sunday).
Parameters
| date:Date — The date to check.
|
Returns
| Boolean — A boolean indicating if the given date is an open one.
|
public static function setRange(beginDate:Date, endDate:Date):Object
Sets the selectable date range for a date component
Parameters
| beginDate:Date |
| |
| endDate:Date |
Returns
public static function validateInterval(beginDate:Date, endDate:Date):Boolean
Use this fucntion to validate a property using two dates
Parameters
| beginDate:Date |
| |
| endDate:Date |
Returns
public static function validateIntervalInRange(beginDate:Date, endDate:Date, range:Array):Boolean
This function is used to validate an interval in a specified date range
Parameters
| beginDate:Date |
| |
| endDate:Date |
| |
| range:Array |
Returns
ActionScript Foundry Bundle Project API Documentation - Generated using Adobe ASDoc / Maven Flex Plugin