import { DateOnly } from "https://deno.land/x/date_only@0.1.0/mod.ts";
A class to represent Dates and the interval of time they represent.
This allows easy and fast creation of an which has the properties
.startEpoch
and .endEpoch
which allow you to check if a given
epoch moment is within that date, before it, after it, etc.
New class instances can be created via new DateOnly(...)
,
DateOnly.newOrUndefined(...)
, DateOnly.fromString(...)
, and
DateOnly.fromStringOrUndefined(...)
.
Constructors
Properties
Static Methods
fromString(s: string, tz?: DateOnlyTimezone): DateOnly
Parse string via parseStringToDateComponents
and then create new DateOnly
fromStringOrUndefined(s: string, tz?: DateOnlyTimezone): DateOnly | undefined
Same as .fromString
, but returns undefined
on failure instead of throwing DateOnlyError
newOrUndefined(): DateOnly | undefined
Same as constructor, but returns undefined
on failure instead of throwing DateOnlyError