Home

# Class goog.date.Interval

Class representing a date/time interval. Used for date calculations.

    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

Instance Method Summary
| `add(?goog.date.Interval interval)` Adds the Interval in the argument to this Interval field by field.
| `clone() ⇒ !goog.date.Interval`
| `equals(?goog.date.Interval other) ⇒ boolean` 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".
| `getInverse() ⇒ !goog.date.Interval`
| `getTotalSeconds() ⇒ number` Gets the total number of seconds in the time interval. Assumes that months and years are empty.
| `times(number n) ⇒ !goog.date.Interval` Calculates n * (this interval) by memberwise multiplication.
| `toIsoString(boolean= opt_verbose) ⇒ ?string` Serializes goog.date.Interval into XML Schema duration (ISO 8601 extended).

Static Method Summary
| `fromIsoString(string duration) ⇒ ?goog.date.Interval` Parses an XML Schema duration (ISO 8601 extended).