Skip to content

startOfUnit

startOfUnit(source: Temporal.PlainDateTime, unit: DateTimeUnit): Temporal.PlainDateTime
import { startOfUnit } from "@northguild/gmt/plain/interval";

Return the start of unit for a Temporal.PlainDateTime, for every DateTimeUnit.

  • Date units delegate to the shared helper; time units truncate via round.

plain/interval/intervalCountDateTime.ts