Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

CalendarKey

CalendarKey: "sameDay" | "nextDay" | "lastDay" | "nextWeek" | "lastWeek" | "sameElse" | string

CalendarSpecVal

CalendarSpecVal: string | ((m?: MomentInput, now?: Moment) => string)

DurationInputArg1

DurationInputArg1: Duration | number | string | FromTo | DurationInputObject | null | undefined

DurationInputArg2

DurationInputArg2: DurationConstructor

LocaleSpecifier

LocaleSpecifier: string | Moment | Duration | string[] | boolean

LongDateFormatKey

LongDateFormatKey: "LTS" | "LT" | "L" | "LL" | "LLL" | "LLLL" | "lts" | "lt" | "l" | "ll" | "lll" | "llll"

MomentFormatSpecification

MomentFormatSpecification: string | MomentBuiltinFormat | (string | MomentBuiltinFormat)[]

MomentInput

MomentInput: Moment | Date | string | number | (number | string)[] | MomentInputObject | null | undefined

MonthWeekdayFn

MonthWeekdayFn: (momentToFormat: Moment, format?: string) => string

Type declaration

    • (momentToFormat: Moment, format?: string): string
    • Parameters

      • momentToFormat: Moment
      • Optional format: string

      Returns string

RelativeTimeFuturePastVal

RelativeTimeFuturePastVal: string | ((relTime: string) => string)

RelativeTimeKey

RelativeTimeKey: "s" | "ss" | "m" | "mm" | "h" | "hh" | "d" | "dd" | "w" | "ww" | "M" | "MM" | "y" | "yy"

RelativeTimeSpecVal

RelativeTimeSpecVal: string | ((n: number, withoutSuffix: boolean, key: RelativeTimeKey, isFuture: boolean) => string)

WeekdaySimpleFn

WeekdaySimpleFn: (momentToFormat: Moment) => string

Type declaration

    • (momentToFormat: Moment): string
    • Parameters

      Returns string

Variables

HTML5_FMT

HTML5_FMT: { DATE: string; DATETIME_LOCAL: string; DATETIME_LOCAL_MS: string; DATETIME_LOCAL_SECONDS: string; MONTH: string; TIME: string; TIME_MS: string; TIME_SECONDS: string; WEEK: string }

Type declaration

  • DATE: string
  • DATETIME_LOCAL: string
  • DATETIME_LOCAL_MS: string
  • DATETIME_LOCAL_SECONDS: string
  • MONTH: string
  • TIME: string
  • TIME_MS: string
  • TIME_SECONDS: string
  • WEEK: string

ISO_8601

Constant used to enable explicit ISO_8601 format parsing.

RFC_2822

defaultFormat

defaultFormat: string

defaultFormatUtc

defaultFormatUtc: string

deprecationHandler

deprecationHandler: ((name: string | null, msg: string) => void) | null | undefined

fn

fn: Moment

suppressDeprecationWarnings

suppressDeprecationWarnings: boolean

version

version: string

Functions

calendarFormat

defineLocale

duration

invalid

isDate

  • isDate(m: any): m is Date
  • Parameters

    • m: any

    Returns m is Date

isDuration

isMoment

  • Parameters

    • m: any

    Returns m is Moment

lang

  • lang(language?: string): string
  • lang(language?: string, definition?: Locale): string
  • deprecated

    in 2.8.0

    Parameters

    • Optional language: string

    Returns string

  • deprecated

    in 2.8.0

    Parameters

    • Optional language: string
    • Optional definition: Locale

    Returns string

locale

  • locale(language?: string): string
  • locale(language?: string[]): string
  • locale(language?: string, definition?: null | LocaleSpecification): string
  • Parameters

    • Optional language: string

    Returns string

  • Parameters

    • Optional language: string[]

    Returns string

  • Parameters

    Returns string

localeData

  • localeData(key?: string | string[]): Locale
  • Parameters

    • Optional key: string | string[]

    Returns Locale

locales

  • locales(): string[]
  • Returns string[]

max

min

months

  • months(): string[]
  • months(index: number): string
  • months(format: string): string[]
  • months(format: string, index: number): string
  • Returns string[]

  • Parameters

    • index: number

    Returns string

  • Parameters

    • format: string

    Returns string[]

  • Parameters

    • format: string
    • index: number

    Returns string

monthsShort

  • monthsShort(): string[]
  • monthsShort(index: number): string
  • monthsShort(format: string): string[]
  • monthsShort(format: string, index: number): string
  • Returns string[]

  • Parameters

    • index: number

    Returns string

  • Parameters

    • format: string

    Returns string[]

  • Parameters

    • format: string
    • index: number

    Returns string

normalizeUnits

  • normalizeUnits(unit: All): string
  • Parameters

    Returns string

now

  • now(): number
  • Returns unix time in milliseconds. Overwrite for profit.

    Returns number

parseTwoDigitYear

  • parseTwoDigitYear(input: string): number
  • Parameters

    • input: string

    Returns number

parseZone

relativeTimeRounding

  • relativeTimeRounding(fn: (num: number) => number): boolean
  • relativeTimeRounding(): (num: number) => number
  • Parameters

    • fn: (num: number) => number
        • (num: number): number
        • Parameters

          • num: number

          Returns number

    Returns boolean

  • Returns (num: number) => number

      • (num: number): number
      • Parameters

        • num: number

        Returns number

relativeTimeThreshold

  • relativeTimeThreshold(threshold: string): number | boolean
  • relativeTimeThreshold(threshold: string, limit: number): boolean
  • Parameters

    • threshold: string

    Returns number | boolean

  • Parameters

    • threshold: string
    • limit: number

    Returns boolean

unix

  • unix(timestamp: number): Moment
  • Parameters

    • timestamp: number

    Returns Moment

updateLocale

utc

  • Parameters

    • Optional inp: MomentInput
    • Optional strict: boolean

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

    Returns Moment

  • Parameters

    • Optional inp: MomentInput
    • Optional format: MomentFormatSpecification
    • Optional strict: boolean

      Strict parsing requires that the format and input match exactly, including delimiters. Strict parsing is frequently the best parsing option. For more information about choosing strict vs forgiving parsing, see the parsing guide.

    Returns Moment

  • Parameters

    • Optional inp: MomentInput
    • Optional format: MomentFormatSpecification
    • Optional language: string
    • Optional strict: boolean

      Strict parsing requires that the format and input match exactly, including delimiters. Strict parsing is frequently the best parsing option. For more information about choosing strict vs forgiving parsing, see the parsing guide.

    Returns Moment

weekdays

  • weekdays(): string[]
  • weekdays(index: number): string
  • weekdays(format: string): string[]
  • weekdays(format: string, index: number): string
  • weekdays(localeSorted: boolean): string[]
  • weekdays(localeSorted: boolean, index: number): string
  • weekdays(localeSorted: boolean, format: string): string[]
  • weekdays(localeSorted: boolean, format: string, index: number): string
  • Returns string[]

  • Parameters

    • index: number

    Returns string

  • Parameters

    • format: string

    Returns string[]

  • Parameters

    • format: string
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean
    • format: string

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • format: string
    • index: number

    Returns string

weekdaysMin

  • weekdaysMin(): string[]
  • weekdaysMin(index: number): string
  • weekdaysMin(format: string): string[]
  • weekdaysMin(format: string, index: number): string
  • weekdaysMin(localeSorted: boolean): string[]
  • weekdaysMin(localeSorted: boolean, index: number): string
  • weekdaysMin(localeSorted: boolean, format: string): string[]
  • weekdaysMin(localeSorted: boolean, format: string, index: number): string
  • Returns string[]

  • Parameters

    • index: number

    Returns string

  • Parameters

    • format: string

    Returns string[]

  • Parameters

    • format: string
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean
    • format: string

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • format: string
    • index: number

    Returns string

weekdaysShort

  • weekdaysShort(): string[]
  • weekdaysShort(index: number): string
  • weekdaysShort(format: string): string[]
  • weekdaysShort(format: string, index: number): string
  • weekdaysShort(localeSorted: boolean): string[]
  • weekdaysShort(localeSorted: boolean, index: number): string
  • weekdaysShort(localeSorted: boolean, format: string): string[]
  • weekdaysShort(localeSorted: boolean, format: string, index: number): string
  • Returns string[]

  • Parameters

    • index: number

    Returns string

  • Parameters

    • format: string

    Returns string[]

  • Parameters

    • format: string
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • index: number

    Returns string

  • Parameters

    • localeSorted: boolean
    • format: string

    Returns string[]

  • Parameters

    • localeSorted: boolean
    • format: string
    • index: number

    Returns string

Generated using TypeDoc