DateUtils
Extends:
Static Method Summary
Static Public Methods | ||
public static |
dateAdd(datePart: *, number: *, date: *): * Adds the specified number of "date parts" to a date, e.g. |
|
public static |
dateDiff(datePart: *, startDate: *, endDate: *): * Determines the number of "dateParts" difference between 2 dates |
|
public static |
dateTimeFormat(date: *, mask: *): * Formats a date into a certain date/time format |
|
public static |
dayOfWeek(date: *): * Gets the day of the week |
|
public static |
dayOfWeekAsNumber(strDayOfWeek: *): * Formats a date to the numeric version of the day of the week |
|
public static |
dayOfWeekAsString(date: *): * Formats a date to the string version of the day of the week |
|
public static |
dayOfWeekIterationOfMonth(iteration: *, strDayOfWeek: *, date: *): * Gets the Xth day of the month. |
|
public static |
dayOfYear(date: *): * Gets the ordinal value or day of the year |
|
public static |
daysInMonth(date: *): * Gets the days in the month |
|
public static |
daysInYear(date: *): * Gets the number of days in the year |
|
public static |
formatString(date: *, mask: *): * Formats a date into a certain date format |
|
public static |
getTimeFormat(date: *, mask: *): * Formats a time into a certain time format |
|
public static |
Determines whether a value is actually a valid date |
|
public static |
isLeapYear(date: *): * Determines whether the year is a leap year or not |
|
public static |
monthAsNumber(strMonth: *): * Formats a month to the numeric version of the month |
|
public static |
monthAsString(date: *): * Formats a date to the string version of the month |
|
public static |
toFlexDayOfWeek(localDayOfWeek: Number): Number Converts the day of the week to a Flex day of the week |
|
public static |
toFlexMonth(localMonth: Number): Number Converts the month to a Flex month |
|
public static |
totalDayOfWeekInMonth(strDayOfWeek: *, date: *): Number Gets the total number of dayOfWeek in the month |
|
public static |
weekOfYear(date: *): * Gets the week of the year |
Method Summary
Public Methods | ||
public |
|
Inherited Summary
From class TypedObject | ||
public |
typeCache: {} |
|
public |
|
|
public |
Returns a list of strings that represent the object hierarchy for this object. |
|
public |
implementsOrExtends(name: *): Boolean Returns true if the class name to check is in the list of class names defined for this class. |
Static Public Methods
public static dateAdd(datePart: *, number: *, date: *): * source
Adds the specified number of "date parts" to a date, e.g. 6 days
Params:
Name | Type | Attribute | Description |
datePart | * | The part of the date that will be added |
|
number | * | The total number of "dateParts" to add to the date |
|
date | * | The date on which to add |
Return:
* | The new date |
public static dateDiff(datePart: *, startDate: *, endDate: *): * source
Determines the number of "dateParts" difference between 2 dates
Params:
Name | Type | Attribute | Description |
datePart | * | The part of the date that will be checked |
|
startDate | * | The starting date |
|
endDate | * | The ending date |
Return:
* | The number of "dateParts" difference |
public static dateTimeFormat(date: *, mask: *): * source
Formats a date into a certain date/time format
Params:
Name | Type | Attribute | Description |
date | * | The date to format |
|
mask | * | How the date should be formatted |
Return:
* | A formatted date |
public static dayOfWeek(date: *): * source
Gets the day of the week
Params:
Name | Type | Attribute | Description |
date | * | The date for which to get the day of the week |
Return:
* | A number representing the day of the week, 0 to 6 |
public static dayOfWeekAsNumber(strDayOfWeek: *): * source
Formats a date to the numeric version of the day of the week
Params:
Name | Type | Attribute | Description |
strDayOfWeek | * | The day of week to convert |
Return:
* | A formatted day of week or -1 if day not found |
public static dayOfWeekAsString(date: *): * source
Formats a date to the string version of the day of the week
Params:
Name | Type | Attribute | Description |
date | * | The date to format |
Return:
* | A formatted day of week |
public static dayOfWeekIterationOfMonth(iteration: *, strDayOfWeek: *, date: *): * source
Gets the Xth day of the month. e.g. get the 3rd Wednesday of the month
Params:
Name | Type | Attribute | Description |
iteration | * | The iteration of the month to get e.g. 4th or Last |
|
strDayOfWeek | * | The day of the week as a string |
|
date | * | The date containing the month and year |
Return:
* | The date of the xth dayOfWeek of the month |
public static dayOfYear(date: *): * source
Gets the ordinal value or day of the year
Params:
Name | Type | Attribute | Description |
date | * | The date for which to get the day of the year |
Return:
* | A number representing the day of the year, 1 to 365 or 366 for a leap year |
public static daysInMonth(date: *): * source
Gets the days in the month
Params:
Name | Type | Attribute | Description |
date | * | The date to check |
Return:
* | The number of days in the month |
public static daysInYear(date: *): * source
Gets the number of days in the year
Params:
Name | Type | Attribute | Description |
date | * | The date to check |
Return:
* | The total number of days in the year |
public static formatString(date: *, mask: *): * source
Formats a date into a certain date format
Params:
Name | Type | Attribute | Description |
date | * | The date to format |
|
mask | * | How the date should be formatted |
Return:
* | A formatted date |
public static getTimeFormat(date: *, mask: *): * source
Formats a time into a certain time format
Params:
Name | Type | Attribute | Description |
date | * | The date to format |
|
mask | * | How the date should be formatted |
Return:
* | A formatted time |
public static isDate(value: String): * source
Determines whether a value is actually a valid date
Params:
Name | Type | Attribute | Description |
value | String | The date value |
Return:
* |
|
public static isLeapYear(date: *): * source
Determines whether the year is a leap year or not
Params:
Name | Type | Attribute | Description |
date | * | The date to check |
Return:
* |
|
public static monthAsNumber(strMonth: *): * source
Formats a month to the numeric version of the month
Params:
Name | Type | Attribute | Description |
strMonth | * | The month to convert |
Return:
* | A formatted month or -1 if month not found |
public static monthAsString(date: *): * source
Formats a date to the string version of the month
Params:
Name | Type | Attribute | Description |
date | * | The date to format |
Return:
* | A formatted month |
public static toFlexDayOfWeek(localDayOfWeek: Number): Number source
Converts the day of the week to a Flex day of the week
Params:
Name | Type | Attribute | Description |
localDayOfWeek | Number | The human readable day of week |
public static toFlexMonth(localMonth: Number): Number source
Converts the month to a Flex month
Params:
Name | Type | Attribute | Description |
localMonth | Number | The human readable month |
public static totalDayOfWeekInMonth(strDayOfWeek: *, date: *): Number source
Gets the total number of dayOfWeek in the month
Params:
Name | Type | Attribute | Description |
strDayOfWeek | * | The day of week to check |
|
date | * | The date containing the month and year |
public static weekOfYear(date: *): * source
Gets the week of the year
Params:
Name | Type | Attribute | Description |
date | * | The date for which to get the week of the year |
Return:
* | A number representing the week of the year, 1 to 53 ( as there are slightly more than 52 weeks of days in a year) |
Public Methods
public getClassNames(): string source
Returns a list of strings that represent the object hierarchy for this object.