date.DateRange Extends
Constructs a date range.

Inheritance

Constructor

goog.date.DateRange(startDateendDate)

Parameters

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

Instance Methods

Public Protected Private
contains(date) boolean
Tests if a date falls within this range.
Arguments:
date : goog.date.Date
The date to test.
Returns: boolean  Whether the date is in the range.
code »
getEndDate() goog.date.Date
No description.
Returns: goog.date.Date  The last date in the range.
code »
getStartDate() goog.date.Date
No description.
Returns: goog.date.Date  The first date in the range.
code »
iterator() !goog.iter.Iterator
No description.
Returns: !goog.iter.Iterator  An iterator over the date range.
code »

Instance Properties

endDate_ : goog.date.Date
The last date in the range.
Code »
startDate_ : goog.date.Date
The first date in the range.
Code »

Static Methods

goog.date.DateRange.allTime(opt_today) !goog.date.DateRange
Returns the range that includes all days between January 1, 1900 and December 31, 9999.
Arguments:
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.
code »
goog.date.DateRange.cloneOrCreate_(opt_today) !goog.date.Date
Clones or creates new.
Arguments:
opt_today : goog.date.Date=
The date to consider today. Defaults to today.
Returns: !goog.date.Date  cloned or new.
code »
goog.date.DateRange.currentOrLastMonday_(date) !goog.date.Date
Calculates the Monday before a date. If the input is a Monday, returns the input. Does not modify its input.
Arguments:
date : goog.date.Date
The input date.
Returns: !goog.date.Date  If |date| is a Monday, return |date|; otherwise return the Monday before |date|.
code »
goog.date.DateRange.equals(ab) boolean
Tests two goog.date.DateRange objects for equality.
Arguments:
a : goog.date.DateRange
A date range.
b : goog.date.DateRange
A date range.
Returns: boolean  Whether |a| is the same range as |b|.
code »
goog.date.DateRange.last7Days(opt_today) !goog.date.DateRange
Returns the range that includes the seven days that end yesterday.
Arguments:
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.
code »
goog.date.DateRange.lastBusinessWeek(opt_today) !goog.date.DateRange
Returns the range that starts seven days before the Monday on or before today and ends the Friday before today.
Arguments:
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.
code »
goog.date.DateRange.lastMonth(opt_today) !goog.date.DateRange
Returns the range that starts the first of last month and ends the last day of last month.
Arguments:
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.
code »
goog.date.DateRange.lastWeek(opt_today) !goog.date.DateRange
Returns the seven-day range that ends the day before the first day of the week (see goog.i18n.DateTimeSymbols.FIRSTDAYOFWEEK) that contains today.
Arguments:
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.
code »
goog.date.DateRange.offsetInDays_(dateoffset) !goog.date.Date
Calculates a date that is a number of days after a date. Does not modify its input.
Arguments:
date : goog.date.Date
The input date.
offset : number
Number of days.
Returns: !goog.date.Date  The date that is |offset| days after |date|.
code »
goog.date.DateRange.offsetInMonths_(dateoffset) !goog.date.Date
Calculates a date that is a number of months after the first day in the month that contains its input. Does not modify its input.
Arguments:
date : goog.date.Date
The input date.
offset : number
Number of months.
Returns: !goog.date.Date  The date that is |offset| months after the first day in the month that contains |date|.
code »
goog.date.DateRange.standardDateRange(dateRangeKeyopt_today) !goog.date.DateRange
No description.
Arguments:
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.
code »
goog.date.DateRange.thisMonth(opt_today) !goog.date.DateRange
Returns the range that starts the first of this month and ends the last day of this month.
Arguments:
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.
code »
goog.date.DateRange.thisWeek(opt_today) !goog.date.DateRange
Returns the seven-day range that starts on the first day of the week (see goog.i18n.DateTimeSymbols.FIRSTDAYOFWEEK) on or before today.
Arguments:
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.
code »
goog.date.DateRange.today(opt_today) !goog.date.DateRange
Returns the range from today to today.
Arguments:
opt_today : goog.date.Date=
The date to consider today. Defaults to today.
Returns: !goog.date.DateRange  The range that includes only today.
code »
goog.date.DateRange.yesterday(opt_today) !goog.date.DateRange
Returns the range from yesterday to yesterday.
Arguments:
opt_today : goog.date.Date=
The date to consider today. Defaults to today.
Returns: !goog.date.DateRange  The range that includes only yesterday.
code »

Static Properties

goog.date.DateRange.MAXIMUM_DATE : goog.date.Date
The last possible day, as far as this class is concerned.
Code »
goog.date.DateRange.MINIMUM_DATE : goog.date.Date
The first possible day, as far as this class is concerned.
Code »

Enumerations

goog.date.DateRange.StandardDateRangeKeys :
Standard date range keys. Equivalent to the enum IDs in DateRange.java http://go/datarange.java
Constants:
ALL_TIME
No description.
LAST_7_DAYS
No description.
LAST_BUSINESS_WEEK
No description.
LAST_MONTH
No description.
LAST_WEEK
No description.
THIS_MONTH
No description.
THIS_WEEK
No description.
TODAY
No description.
YESTERDAY
No description.
Code »

Package date

Package Reference