Formatter.util.date Class
Date utility functions for the Gregorian calendar.
Item Index
Methods
- century static
- dayOfWeek static
- dayOfYear static
- daysOfMonth static
- daysOfYear static
- firstDayOfMonth static
- firstDayOfWeek static
- firstDayOfYear static
- isAM static
- isLeapYear static
- isoWeek static
- isPM static
- lastDayOfMonth static
- lastDayOfWeek static
- lastDayOfYear static
- nthDayOfWeek static
- pastCenturies static
- timestamp static
Properties
- MILLISECONDS_PER_DAY static
- MILLISECONDS_PER_HOUR static
- MILLISECONDS_PER_WEEK static
Methods
century
-
date
Returns the century specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
dayOfWeek
-
date -
culture
Returns the culture-specific weekday of the given date. The first day of the week corresponds to 0, the last day to 6.
Parameters:
-
dateDateInterpreted as a UTC value
-
cultureObjectCulture information
Returns:
dayOfYear
-
date
Returns the day of the year specified by the given date. The first day of the year corresponds to 1.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
daysOfMonth
-
date
Returns the number of days for the specified month.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
daysOfYear
-
arg
Returns the number of days for the specified year.
Parameters:
-
argDate | Number(Date is interpreted as a UTC value)
Returns:
firstDayOfMonth
-
date
Returns a date representing the first day of the month specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
firstDayOfWeek
-
date -
culture
Returns a date representing the first day of the week specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
-
cultureObjectCulture information
Returns:
firstDayOfYear
-
arg
Returns a date representing the first day of the specified year.
Parameters:
-
argDate | Number(Date is interpreted as a UTC value)
Returns:
isAM
-
date
Returns true if the time specified by the given date is in the range [00:00, 12:00). Returns false otherwise.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
isLeapYear
-
arg
Returns true if the specified year is a leap year, false otherwise.
Parameters:
-
argDate | Number(Date is interpreted as a UTC value)
Returns:
isoWeek
-
date
Returns the ISO-8601 week specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
isPM
-
date
Returns true if the time specified by the given date is in the range [12:00, 00:00). Returns false otherwise.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
lastDayOfMonth
-
date
Returns a date representing the last day of the month specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
lastDayOfWeek
-
date -
culture
Returns a date representing the first day of the week specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
-
cultureObjectCulture information
Returns:
lastDayOfYear
-
arg
Returns a date representing the last day of the specified year.
Parameters:
-
argDate | Number(Date is interpreted as a UTC value)
Returns:
nthDayOfWeek
-
date -
culture -
n
Returns a date representing the n-th day of the week specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
-
cultureObjectCulture information
-
nNumberIn [0,6]
Returns:
Example:
var d = new Date('2012-07-04T00:00Z'), //Wednesday
c = { firstDayOfWeek: 1 }; //culture with Monday as first weekday
Formatter.util.date.nthDayOfWeek(
d, c, 0); //Date representing '2012-07-02T00:00'
Formatter.util.date.nthDayOfWeek(
d, c, 6); //Date representing '2012-07-08T00:00'
pastCenturies
-
date
Returns the number of past centuries specified by the given date.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
timestamp
-
date
Returns the UNIX timestamp of the given date. The UNIX timestamp describes a UTC date as number of seconds elapsed since the beginning of the UNIX epoche (Midnight, 1970-01-01). Milliseconds of the given date are truncated.
Parameters:
-
dateDateInterpreted as a UTC value
Returns:
Properties
MILLISECONDS_PER_DAY
Number
final
static
Milliseconds per day.
MILLISECONDS_PER_HOUR
Number
final
static
Milliseconds per hour.
MILLISECONDS_PER_WEEK
Number
final
static
Milliseconds per week.
