Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

§Interfaces

AdditionalTokensOptions

Additional tokens options. Used to build function options.

DateValues

The date values, used to set or get date object values.

Duration

The duration object. Contains the duration in the units specified by the object.

FirstWeekContainsDateOptions

The first week contains date options. Used to build function options.

FormatDistanceFnOptions

The FormatDistanceFn function options.

FormatLong

The object with functions that return localized formats. Long stands for sequence of tokens (i.e. PPpp) that allows to define how format both date and time at once. Part of the public locale API.

FormatLongFnOptions

The FormatLongFn function options.

FormatPart

A format part that represents a token or string literal, used by format parser/tokenizer

FormatRelativeFnOptions

The FormatRelativeFn function options.

FormatRelativeTokenFnOptions

The FormatRelativeTokenFn function options.

FPFn1

FP function interface with 1 arguments.

FPFn2

FP function interface with 2 arguments.

FPFn3

FP function interface with 3 arguments.

FPFn4

FP function interface with 4 arguments.

GenericDateConstructor

The generic date constructor. Replicates the Date constructor. Used to build generic functions.

Interval

An object that combines two dates to represent the time interval.

ISOFormatOptions

The ISO format function options. Used to build function options.

Locale

The locale object with all functions and data needed to parse and format dates. This is what each locale implements and exports.

LocaleOptions

The locale options.

Localize

The object with functions used to localize various values. Part of the public locale API.

LocalizedOptions

The localized function options. Used to build function options.

LocalizeFnOptions

The LocalizeFn function options.

Match

The object with functions used to match and parse various localized values.

MatchFnOptions

The MatchFn function options.

MatchFnResult

The MatchFn function result.

NearestToUnitOptions

The nearest unit function options. Used to build function options.

NormalizedInterval

A version of Interval that has both start and end resolved to Date.

RoundingOptions

The rounding options. Used to build function options.

StepOptions

The step function options. Used to build function options.

WeekOptions

The week function options. Used to build function options.

§Type Aliases

Day

The day of the week type alias. Unlike the date (the number of days since the beginning of the month), which begins with 1 and is dynamic (can go up to 28, 30, or 31), the day starts with 0 and static (always ends at 6). Look at it as an index in an array where Sunday is the first element and Saturday is the last.

DurationUnit

The duration unit type alias.

Era

The era. Can be either 0 (AD - Anno Domini) or 1 (BC - Before Christ).

FirstWeekContainsDate

FirstWeekContainsDate is used to determine which week is the first week of the year, based on what day the January, 1 is in that week.

FormatDistanceFn

The function that takes a token (i.e. halfAMinute) passed by formatDistance or formatDistanceStrict and payload, and returns localized distance.

FormatDistanceLocale

The tokens map to string templates used in the format distance function. It looks like this:

FormatDistanceToken

The token used in the format distance function. Represents the distance unit with prespecified precision.

FormatDistanceTokenFn

The function used inside the FormatDistanceFn function, implementing formatting for a particular token.

FormatLongFn

The format long function. Formats date, time or both.

FormatLongWidth

The format long width token, defines how short or long the formnatted value might be. The actual result length is defined by the locale.

FormatRelativeFn

The locale function that does the work for the formatRelative function.

FormatRelativeToken

The token used in format relative function. Represents the time unit.

FormatRelativeTokenFn

The locale function used inside the FormatRelativeFn function implementing formatting for a particular token.

FPArity

The supported arity type.

FPFn

FP function interface. It infers the arity of the function and returns the corresponding FP function interface.

FPFnInput

The type of a function that can be converted to FP.

ISOStringFormat

The ISO string format.

ISOStringRepresentation

The ISO date representation. Represents which component the string includes, date, time or both.

LocaleDayPeriod

Token representing particular period of the day.

LocaleUnit

The units commonly used in the date formatting or parsing.

LocaleUnitValue

The formatting unit value, represents the raw value that can be formatted.

LocaleWidth

The format width. Defines how short or long the formatted string might be. The actaul result length depends on the locale.

LocalizeFn

Individual localize function. Part of Localize.

MatchFn

The match function. Part of Match. Implements matcher for particular unit type.

MatchValueCallback

The function that allows to map the matched value to the actual type.

Month

The month type alias. Goes from 0 to 11, where 0 is January and 11 is December.

NearestHours

Nearest hour type. Goes from 1 to 12, where 1 is the nearest hour and 12 is nearest half a day.

NearestMinutes

Nearest minute type. Goes from 1 to 30, where 1 is the nearest minute and 30 is nearest half an hour.

NearestMinutesOptions deprecated

The nearest minutes function options. Used to build function options.

Quarter

The year quarter. Goes from 1 to 4.

RoundingMethod

The number rounding method.