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
goog.date.Interval |
opt_years
: number | string=
Years or string representing date part.
|
opt_months
: number=
Months or number of whatever date part specified
by first parameter.
|
opt_days
: number=
Days.
|
opt_hours
: number=
Hours.
|
opt_minutes
: number=
Minutes.
|
opt_seconds
: number=
Seconds.
|
![]()
Adds the Interval in the argument to this Interval field by field.
Arguments:
|
code » | ||
No description.
Returns: !goog.date.Interval
A clone of the interval object.
|
code » | ||
Tests whether the given interval is equal to this interval.
Note, this is a simple field-by-field comparison, it doesn't
account for comparisons like "12 months == 1 year".
Arguments:
Returns: boolean
Whether the intervals are equal.
|
code » | ||
No description.
Returns: !goog.date.Interval
Negative of this interval.
|
code » | ||
Gets the total number of seconds in the time interval. Assumes that months
and years are empty.
Returns: number
Total number of seconds in the interval.
|
code » | ||
No description.
Returns: boolean
Whether all fields of the interval are zero.
|
code » | ||
Calculates n * (this interval) by memberwise multiplication.
Arguments:
Returns: !goog.date.Interval
n * this.
|
code » | ||
Serializes goog.date.Interval into XML Schema duration (ISO 8601 extended).
Arguments:
Returns: ?string
An XML schema duration in ISO 8601 extended format,
or null if the interval contains both positive and negative fields.
|
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 » |
![]()
Days constant for the date parts.
|
Code » | |
![]()
Hours constant for the date parts.
|
Code » | |
![]()
Minutes constant for the date parts.
|
Code » | |
![]()
Months constant for the date parts.
|
Code » | |
![]()
Seconds constant for the date parts.
|
Code » | |
![]()
Years constant for the date parts.
|
Code » |