Callback function for each date in the requested increments.
Returns
Array<Date>
Array of Dates for each increment.
public eachMinute(fn?: (d: Date) => void): Array<Date>
see
eachMillisecond
Parameters
fn?: (d: Date) => voidoptional
Returns
Array<Date>
public eachMonth(fn?: (d: Date) => void): Array<Date>
see
eachMillisecond
Parameters
fn?: (d: Date) => voidoptional
Returns
Array<Date>
public eachSecond(fn?: (d: Date) => void): Array<Date>
see
eachMillisecond
Parameters
fn?: (d: Date) => voidoptional
Returns
Array<Date>
public eachWeek(fn?: (d: Date) => void): Array<Date>
see
eachMillisecond
Parameters
fn?: (d: Date) => voidoptional
Returns
Array<Date>
public eachYear(fn?: (d: Date) => void): Array<Date>
see
eachMillisecond
Parameters
fn?: (d: Date) => voidoptional
Returns
Array<Date>
public every(ms: number, fn?: (d: Date) => void): Array<Date>
Iterates through the DateRange for every ,
calling [fn] if it is passed. Returns an array of each increment visited.
method
every(, [fn])
extra
When is a number, increments will be to the exact millisecond.
can also be a string in the format %{number} {unit}s%, in which
case it will increment in the unit specified. Note that a discrepancy exists
in the case of months, as %(2).months()% is an approximation. Stepping
through the actual months by passing %"2 months"% is usually preferable in
this case.
Returns a new DateRange with the latest starting point as its start, and the
earliest ending point as its end. If the two ranges do not intersect this will
effectively produce an invalid range.
example
Date.range('2003-01', '2005-01').intersect(Date.range('2004-01', '2006-01')) -> Jan 1, 2004..Jan 1, 2005
Returns a new DateRange with the earliest starting point as its start,
and the latest ending point as its end. If the two ranges do not intersect
this will effectively remove the "gap" between them.
example
Date.range('2003=01', '2005-01').union(Date.range('2004-01', '2006-01')) -> Jan 1, 2003..Jan 1, 2006