GitHub image
moment
⌘K
Exports
Readme

Default Export

default
Docs
Import
Tests
3
References
2
function default(
inp?: MomentInput,

Strict parsing disables the deprecated fallback to the native Date constructor when parsing a string.

strict?: boolean
): Moment+2
Functions
20
utc
Docs
Import
Tests
3
References
2
function utc(
inp?: MomentInput,

Strict parsing disables the deprecated fallback to the native Date constructor when parsing a string.

strict?: boolean
): Moment+2
unix
Docs
Import
Tests
3
References
2
function unix(timestamp: number): Moment
invalid
Docs
Import
Tests
3
References
2
function invalid(flags?: MomentParsingFlagsOpt): Moment
isMoment
Docs
Import
Tests
3
References
2
function isMoment(m: any): boolean
isDate
Docs
Import
Tests
3
References
2
function isDate(m: any): boolean
isDuration
Docs
Import
Tests
3
References
2
function isDuration(d: any): boolean
lang
Docs
Import
Tests
3
References
2
function lang(language?: string): string+1
locale
Docs
Import
Tests
3
References
2
function locale(language?: string): string+2
localeData
Docs
Import
Tests
3
References
2
function localeData(key?: string | string[]): Locale
duration
Docs
Import
Tests
3
References
2
function duration(inp?: DurationInputArg1, unit?: DurationConstructor): Duration
parseZone
Docs
Import
Tests
3
References
2
function parseZone(
inp?: MomentInput,
strict?: boolean
): Moment+1
months
Docs
Import
Tests
3
References
2
function months(): string[]+3
monthsShort
Docs
Import
Tests
3
References
2
function monthsShort(): string[]+3
weekdays
Docs
Import
Tests
3
References
2
function weekdays(): string[]+7
weekdaysShort
Docs
Import
Tests
3
References
2
function weekdaysShort(): string[]+7
weekdaysMin
Docs
Import
Tests
3
References
2
function weekdaysMin(): string[]+7
min
Docs
Import
Tests
3
References
2
function min(moments: Moment[]): Moment+1
max
Docs
Import
Tests
3
References
2
function max(moments: Moment[]): Moment+1
now
Docs
Import
Tests
3
References
2

Returns unix time in milliseconds. Overwrite for profit.

function now(): number
defineLocale
Docs
Import
Tests
3
References
2
function defineLocale(language: string, localeSpec: LocaleSpecification): Locale
Description
Parse, validate, manipulate, and display dates
Install
yarn add moment
Copy
Details
MIT License
0 Dependencies
Native TypeScript Package
Metrics
Weekly Downloads