goog.date.Interval
Classgoog.date.Interval(opt_years, opt_months, opt_days, opt_hours, opt_minutes,
opt_seconds)
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
opt_years
{number
|string
=}
opt_months
{number
=}
opt_days
{number
=}
opt_hours
{number
=}
opt_minutes
{number
=}
opt_seconds
{number
=}
.DAYS
{string
}Days constant for the date parts.
.HOURS
{string
}Hours constant for the date parts.
.MINUTES
{string
}Minutes constant for the date parts.
.MONTHS
{string
}Months constant for the date parts.
.SECONDS
{string
}Seconds constant for the date parts.
.YEARS
{string
}Years constant for the date parts.
.add(interval)
Adds the Interval in the argument to this Interval field by field.
interval
{goog.date.Interval
}
.clone()
goog.date.Interval
}
.equals(other)
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".
other
{goog.date.Interval
}
boolean
}
.fromIsoString(duration)
Parses an XML Schema duration (ISO 8601 extended).
duration
{string
}
goog.date.Interval
}
.getInverse()
goog.date.Interval
}
.getTotalSeconds()
Gets the total number of seconds in the time interval. Assumes that months and years are empty.
number
}
.isZero()
boolean
}
.times(n)
Calculates n * (this interval) by memberwise multiplication.
n
{number
}
goog.date.Interval
}
.toIsoString(opt_verbose)
Serializes goog.date.Interval into XML Schema duration (ISO 8601 extended).
opt_verbose
{boolean
=}
string
}