Skip to content

@eightkk/vue-weave / core / calendarBands

Function: calendarBands() ​

calendarBands(range, unit, options?): TimelineBand[]

Defined in: src/core/timeline.ts:751

Build one header band level from calendar units in epoch milliseconds. Bands are aligned to a fixed UTC offset or to local time in an IANA timeZone, clipped to the range and labelled from their unclipped boundaries: ISO-like by default, with Intl.DateTimeFormat when locale or labelFormat is set, or by a custom label function.

With timeZone, day, week, month and year bands start at the first instant of their local date: local midnight, or the end of a daylight-saving gap that skips midnight. A local date that the zone skips entirely has no band. Hour bands start where local time reaches a multiple of step hours counted from local midnight, so a 23-hour day has 23 one-hour bands and a 25-hour day 25, with the repeated hour twice. A grid hour inside a gap starts its band at the end of the gap, so its band is shorter (and absent when the gap ends on the next grid hour).

Parameters ​

range ​

TimeRange

unit ​

CalendarBandUnit

options? ​

CalendarBandOptions = {}

Returns ​

TimelineBand[]

Released under the MIT License.