Class: DateRangeEntry

DateRangeEntry()

Entry covering a span of the year rather than a single day, recurring annually. A span whose end falls before its start wraps into the next year, which is how most sports seasons and two of the zodiac signs behave. Example: `NFL Regular Season,range:09/04-01/04`

Constructor

new DateRangeEntry()

Source:

Classes

DateRangeEntry

Members

wrapsYear

Whether the span crosses into the following calendar year.
Source:

Methods

getNextOccurrence(fromDate)

Returns the next start date, i.e. when the span next opens.
Parameters:
Name Type Description
fromDate The date to calculate from (default: today)
Source:
Returns:
The next start date

getOccurrencesInRange(startDate, endDate)

Gets the start dates of every span that opens within the given window.
Parameters:
Name Type Description
startDate Start of the window
endDate End of the window
Source:
Returns:
Array of span start dates

getRangeFor(year)

Gets the concrete span for the year the run starts in.
Parameters:
Name Type Description
year The year the span starts in
Source:
Returns:
The start and end dates, both inclusive

occursOn(date)

Whether the given date falls anywhere inside the span, endpoints included.
Parameters:
Name Type Description
date The date to check
Source:
Returns:
true if the date is within the span