Skip to content

each

Generates an iterator over all dates between two inclusive bounds, following a granularity (Unit).

Interactive example

Syntax

typescript
function each(
	range: { start: TheDate; end: TheDate },
	unit?: Unit
): Generator<TheDate>

Parameters

  • range.start / range.end: Bounds of the iteration (TheDate).
  • unit: Unit (day by default).

Return value

A generator that emits each TheDate according to the specified unit.

See also

Released under the MIT license.