The goog.date.DateRange Class

goog.date.DateRange(startDate, endDate)

Constructs a date range.

startDate {goog.date.Date}
The first date in the range.
endDate {goog.date.Date}
The last date in the range.

The goog.date.DateRange.Iterator Class

Creates an iterator over the dates in a {@link goog.date.DateRange}. … more

.MAXIMUM_DATE {goog.date.Date}

The last possible day, as far as this class is concerned.

.MINIMUM_DATE {goog.date.Date}

The first possible day, as far as this class is concerned.

The goog.date.DateRange.StandardDateRangeKeys Enum

Standard date range keys. Equivalent to the enum IDs in DateRange.java http://go/datarange.java … more

.allTime(opt_today)

Returns the range that includes all days between January 1, 1900 and December 31, 9999.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that includes all days between January 1, 1900 and December 31, 9999.

.equals(a, b)

Tests two {@link goog.date.DateRange} objects for equality.

a {goog.date.DateRange}
A date range.
b {goog.date.DateRange}
A date range.
returns {boolean}
Whether |a| is the same range as |b|.

.getEndDate()

returns {goog.date.Date}
The last date in the range.

.getStartDate()

returns {goog.date.Date}
The first date in the range.

.iterator()

returns {goog.iter.Iterator}
An iterator over the date range.

.last7Days(opt_today)

Returns the range that includes the seven days that end yesterday.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that includes the seven days that end yesterday.

.lastBusinessWeek(opt_today)

Returns the range that starts seven days before the Monday on or before today and ends the Friday before today.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that starts seven days before the Monday on or before today and ends the Friday before today.

.lastMonth(opt_today)

Returns the range that starts the first of last month and ends the last day of last month.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that starts the first of last month and ends the last day of last month.

.lastWeek(opt_today)

Returns the seven-day range that ends the day before the first day of the week (see {@link goog.i18n.DateTimeSymbols.FIRSTDAYOFWEEK}) that contains today.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that starts seven days before the Monday on or before today and ends the Sunday on or before yesterday.

.standardDateRange(dateRangeKey, opt_today)

dateRangeKey {string}
A standard date range key.
opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The date range that corresponds to that key.
@throws
{Error} If no standard date range with that key exists.

.thisMonth(opt_today)

Returns the range that starts the first of this month and ends the last day of this month.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that starts the first of this month and ends the last day of this month.

.thisWeek(opt_today)

Returns the seven-day range that starts on the first day of the week (see {@link goog.i18n.DateTimeSymbols.FIRSTDAYOFWEEK}) on or before today.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that starts the Monday on or before today and ends the Sunday on or after today.

.today(opt_today)

Returns the range from today to today.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that includes only today.

.yesterday(opt_today)

Returns the range from yesterday to yesterday.

opt_today {goog.date.Date=}
The date to consider today. Defaults to today.
returns {goog.date.DateRange}
The range that includes only yesterday.