new goog.date.Interval(0, 1) // One month new goog.date.Interval(0, 0, 3, 1) // Three days and one hour new goog.date.Interval(goog.date.Interval.DAYS, 1) // One day
Compares two dates. May be used as a sorting function.
Arguments:
Returns: number
Comparison result. 0 if dates are the same, less than 0 if
date1 is earlier than date2, greater than 0 if date1 is later than date2.
|
code » | ||||||
Formats a month/year string.
Example: "January 2008"
|
code » | ||||||
Creates a DateTime from a datetime string expressed in ISO 8601 format.
Arguments:
Returns: goog.date.DateTime
Parsed date or null if parse fails.
|
code » | ||||||
Parses an XML Schema duration (ISO 8601 extended).
Arguments:
Returns: goog.date.Interval
The duration as a goog.date.Interval or null
if the parse fails.
|
code » | ||||||
Creates a DateTime from a datetime string expressed in RFC 822 format.
Arguments:
Returns: goog.date.DateTime
Parsed date or null if parse fails.
|
code » | ||||||
No description.
Arguments:
|
code » | ||||||
Returns the number of days for a given month.
|
code » | ||||||
Static function for week number calculation. ISO 8601 implementation.
Arguments:
Returns: number
The week number (1-53).
|
code » | ||||||
Returns whether the given year is a leap year.
|
code » | ||||||
Returns whether the given year is a long ISO year.
See
http://www.phys.uu.nl/~vgent/calendar/isocalendar_text3.htm .
|
code » | ||||||
Returns true if the 2 dates are in the same day.
Arguments:
Returns: boolean
Whether the dates are on the same day.
|
code » | ||||||
Returns true if the 2 dates are in the same month.
Arguments:
Returns: boolean
Whether the dates are in the same calendar month.
|
code » | ||||||
Returns true if the 2 dates are in the same year.
Arguments:
Returns: boolean
Whether the dates are in the same calendar year.
|
code » | ||||||
![]()
No description.
Arguments:
Returns: !(T | S)
The later of them in time.
|
code » | ||||||
![]()
No description.
Arguments:
Returns: !(T | S)
The earlier of them in time.
|
code » | ||||||
![]()
Sets date fields based on an ISO 8601 week string.
See
http://en.wikipedia.org/wiki/ISO_week_date , "Relation with the
Gregorian Calendar". The first week of a new ISO year is the week with the
majority of its days in the new Gregorian year. I.e., ISO Week 1's Thursday
is in that year. ISO weeks always start on Monday. So ISO Week 1 can
contain a few days from the previous Gregorian year. And ISO weeks always
end on Sunday, so the last ISO week (Week 52 or 53) can have a few days from
the following Gregorian year.
Example: '1997-W01' lasts from 1996-12-30 to 1997-01-05. January 1, 1997 is
a Wednesday. So W01's Monday is Dec.30, 1996, and Sunday is January 5, 1997.
Arguments:
|
code » | ||||||
Sets date fields based on an ISO 8601 format string.
Arguments:
Returns: boolean
Whether the parsing succeeded.
|
code » | ||||||
Parses a datetime string expressed in ISO 8601 format. Overwrites the date
and optionally the time part of the given object with the parsed values.
Arguments:
Returns: boolean
Whether the parsing succeeded.
|
code » | ||||||
Sets time fields based on an ISO 8601 format string.
Note: only time fields, not date fields.
Arguments:
Returns: boolean
Whether the parsing succeeded.
|
code » |