Skip to content
0

katanakit-js / DateUnitSchema

Variable: DateUnitSchema ​

ts
const DateUnitSchema: ZodEnum<{
  days: "days";
  hours: "hours";
  minutes: "minutes";
  months: "months";
  quarters: "quarters";
  weeks: "weeks";
  years: "years";
}>;

Defined in: src/schemas/core.schema.ts:73

Granularity of a date calculation, matching Notion's formula vocabulary.

Quarters are included because a calendar quarter is the unit a business actually reports in, and it is exactly three months — no extra calendar concept needed. Ordered coarsest to finest so a sorted union stays readable.

Released under the MIT License.