Skip to main content

Function: lastCoveredInstant()

lastCoveredInstant(span): Instant

Defined in: time/format.ts:101

The last moment a half-open span [start, end) actually covers — end itself is the boundary after the span, one millisecond past its last covered moment. Instant arithmetic only, so it takes no time zone: end − 1 ms is the same subtraction in every zone.

Takes the whole span, not end alone, because a zero-length span (end === start) has no millisecond before its own start to name — end - 1 there reads as one moment earlier than start (#240). A zero-length span answers its own end unchanged instead. start may be absent (no paired start Field value yet); the zero-length check then never fires.

Parameters​

span​

end​

Instant

start?​

Instant

Returns​

Instant