Skip to main content
Module

x/complaindate/PlainDate.ts>ComPlainDate

JavaScript date-time utilities that keep timezones on the surface
Latest
interface ComPlainDate
import { type ComPlainDate } from "https://deno.land/x/complaindate@v1.0.1/PlainDate.ts";

Describes a basic plain-date object with minimal properties.

Properties

year: number

Year may be negative and up to 6 digits

Month (1-12)

day: number

Day in month (1-31)

iso: string

yyyy-mm-dd (ISO 8601)

valueOf: () => this["iso"]

yyyy-mm-dd (ISO 8601)

toString: () => this["iso"]

yyyy-mm-dd (ISO 8601)

toJSON: () => this["iso"]

yyyy-mm-dd (ISO 8601)

toLocaleString: (locale?: Intl.LocalesArgument, options?: FormatPlainDateOptions) => string

Localize the date for display to a user.

toUtcInstant: (time?: { hour?: number | string; minute?: number | string; second?: number | string; millisecond?: number | string; }) => Date

Get a native JS Date object in UTC.

is: (x: RequireAtLeastOne<{ year?: number | string; month?: number | string; day?: number | string; }>) => boolean

Check for partial or complete equality.

constructor: PlainDateFactory<this>
pipe: <T extends ComPlainDate>(this: T, ...fns: Array<(date: T) => T>) => T

Apply a pipeline of functions to this plain-date, from left to right.

map: <T extends ComPlainDate>(this: T, f: (x: T) => { year: number | string; month: number | string; day: number | string; }) => T

Create a new plain-date object from this one, modified by a function.