Interface Moment

Index

Methods

Methods

public add(unitOfTime: string, amount: number): Moment

Mutates the original moment by adding time.

Parameters

  • unitOfTime: string

    the key of what time you want to add (eg "years" / "hours" etc)

  • amount: number

    the amount you want to add

Returns

Moment

public add(amount: number, unitOfTime: string): Moment

Mutates the original moment by adding time.

Parameters

  • amount: number

    the amount you want to add

  • unitOfTime: string

    the key of what time you want to add (eg "years" / "hours" etc)

Returns

Moment

public add(unitOfTime: string, amount: string): Moment

Mutates the original moment by adding time.

Parameters

  • unitOfTime: string

    the key of what time you want to add (eg "years" / "hours" etc)

  • amount: string

    the amount you want to add

Returns

Moment

public add(objectLiteral: MomentInput): Moment

Mutates the original moment by adding time.

Parameters

  • objectLiteral: MomentInput

    an object literal that describes multiple different keys at the same time {days:7,months:1}

Returns

Moment

public add(duration: Duration): Moment

Mutates the original moment by adding time.

Parameters

Returns

Moment

public calendar(): string

Returns

string

public clone(): Moment

Returns

Moment

public date(d: number): Moment

Parameters

  • d: number

Returns

Moment

public date(): number

Returns

number

public day(d: number): Moment

Parameters

  • d: number

Returns

Moment

public day(d: string): Moment

Parameters

  • d: string

Returns

Moment

public day(): number

Returns

number

public daysInMonth(): number

Returns

number

public diff(b: Moment): number

Parameters

Returns

number

public diff(b: Moment, unitOfTime: string): number

Parameters

  • b: Moment
  • unitOfTime: string

Returns

number

public diff(b: Moment, unitOfTime: string, round: boolean): number

Parameters

  • b: Moment
  • unitOfTime: string
  • round: boolean

Returns

number

public endOf(unitOfTime: string): Moment

Parameters

  • unitOfTime: string

Returns

Moment

public format(format: string): string

Parameters

  • format: string

Returns

string

public format(): string

Returns

string

public from(f: Moment): string

Parameters

Returns

string

public from(f: Moment, suffix: boolean): string

Parameters

Returns

string

public from(d: Date): string

Parameters

  • d: Date

Returns

string

public from(s: string): string

Parameters

  • s: string

Returns

string

public from(date: Array<number>): string

Parameters

  • date: Array<number>

Returns

string

public fromNow(withoutSuffix?: boolean): string

Parameters

  • withoutSuffix?: boolean optional

Returns

string

public get(unit: string): number

Parameters

  • unit: string

Returns

number

public hours(h: number): Moment

Parameters

  • h: number

Returns

Moment

public hours(): number

Returns

number

public isAfter(): boolean

Returns

boolean

public isAfter(b: Moment): boolean

Parameters

Returns

boolean

public isAfter(b: string): boolean

Parameters

  • b: string

Returns

boolean

public isAfter(b: Number): boolean

Parameters

  • b: Number

Returns

boolean

public isAfter(b: Date): boolean

Parameters

  • b: Date

Returns

boolean

public isAfter(b: Array<number>): boolean

Parameters

  • b: Array<number>

Returns

boolean

public isAfter(b: Moment, granularity: string): boolean

Parameters

  • b: Moment
  • granularity: string

Returns

boolean

public isAfter(b: String, granularity: string): boolean

Parameters

  • b: String
  • granularity: string

Returns

boolean

public isAfter(b: Number, granularity: string): boolean

Parameters

  • b: Number
  • granularity: string

Returns

boolean

public isAfter(b: Date, granularity: string): boolean

Parameters

  • b: Date
  • granularity: string

Returns

boolean

public isAfter(b: Array<number>, granularity: string): boolean

Parameters

  • b: Array<number>
  • granularity: string

Returns

boolean

public isBefore(): boolean

Returns

boolean

public isBefore(b: Moment): boolean

Parameters

Returns

boolean

public isBefore(b: string): boolean

Parameters

  • b: string

Returns

boolean

public isBefore(b: Number): boolean

Parameters

  • b: Number

Returns

boolean

public isBefore(b: Date): boolean

Parameters

  • b: Date

Returns

boolean

public isBefore(b: Array<number>): boolean

Parameters

  • b: Array<number>

Returns

boolean

public isBefore(b: Moment, granularity: string): boolean

Parameters

  • b: Moment
  • granularity: string

Returns

boolean

public isBefore(b: String, granularity: string): boolean

Parameters

  • b: String
  • granularity: string

Returns

boolean

public isBefore(b: Number, granularity: string): boolean

Parameters

  • b: Number
  • granularity: string

Returns

boolean

public isBefore(b: Date, granularity: string): boolean

Parameters

  • b: Date
  • granularity: string

Returns

boolean

public isBefore(b: Array<number>, granularity: string): boolean

Parameters

  • b: Array<number>
  • granularity: string

Returns

boolean

public isDST(): boolean

Returns

boolean

public isLeapYear(): boolean

Returns

boolean

public isSame(b: Moment): boolean

Parameters

Returns

boolean

public isSame(b: string): boolean

Parameters

  • b: string

Returns

boolean

public isSame(b: Number): boolean

Parameters

  • b: Number

Returns

boolean

public isSame(b: Date): boolean

Parameters

  • b: Date

Returns

boolean

public isSame(b: Array<number>): boolean

Parameters

  • b: Array<number>

Returns

boolean

public isSame(b: Moment, granularity: string): boolean

Parameters

  • b: Moment
  • granularity: string

Returns

boolean

public isSame(b: String, granularity: string): boolean

Parameters

  • b: String
  • granularity: string

Returns

boolean

public isSame(b: Number, granularity: string): boolean

Parameters

  • b: Number
  • granularity: string

Returns

boolean

public isSame(b: Date, granularity: string): boolean

Parameters

  • b: Date
  • granularity: string

Returns

boolean

public isSame(b: Array<number>, granularity: string): boolean

Parameters

  • b: Array<number>
  • granularity: string

Returns

boolean

public isValid(): boolean

Returns

boolean

public isoWeek(): number

Returns

number

public isoWeek(d: number): Moment

Parameters

  • d: number

Returns

Moment

public isoWeekYear(): number

Returns

number

public isoWeekYear(d: number): Moment

Parameters

  • d: number

Returns

Moment

public isoWeekday(): number

Returns

number

public isoWeekday(d: number): Moment

Parameters

  • d: number

Returns

Moment

public isoWeeks(): number

Returns

number

public isoWeeks(d: number): Moment

Parameters

  • d: number

Returns

Moment

public lang(language: string)

Parameters

  • language: string

public lang(reset: boolean)

Parameters

  • reset: boolean

public lang(): string

Returns

string

public local(): Moment

Returns

Moment

public max(date: Date): Moment

Parameters

  • date: Date

Returns

Moment

public max(date: number): Moment

Parameters

  • date: number

Returns

Moment

public max(date: Array<any>): Moment

Parameters

  • date: Array<any>

Returns

Moment

public max(date: string): Moment

Parameters

  • date: string

Returns

Moment

public max(date: string, format: string): Moment

Parameters

  • date: string
  • format: string

Returns

Moment

public max(clone: Moment): Moment

Parameters

Returns

Moment

public milliseconds(ms: number): Moment

Parameters

  • ms: number

Returns

Moment

public milliseconds(): number

Returns

number

public min(date: Date): Moment

Parameters

  • date: Date

Returns

Moment

public min(date: number): Moment

Parameters

  • date: number

Returns

Moment

public min(date: Array<any>): Moment

Parameters

  • date: Array<any>

Returns

Moment

public min(date: string): Moment

Parameters

  • date: string

Returns

Moment

public min(date: string, format: string): Moment

Parameters

  • date: string
  • format: string

Returns

Moment

public min(clone: Moment): Moment

Parameters

Returns

Moment

public minutes(m: number): Moment

Parameters

  • m: number

Returns

Moment

public minutes(): number

Returns

number

public month(M: number): Moment

Parameters

  • M: number

Returns

Moment

public month(M: string): Moment

Parameters

  • M: string

Returns

Moment

public month(): number

Returns

number

public quarter(): number

Returns

number

public seconds(s: number): Moment

Parameters

  • s: number

Returns

Moment

public seconds(): number

Returns

number

public set(unit: string, value: number): Moment

Parameters

  • unit: string
  • value: number

Returns

Moment

public startOf(unitOfTime: string): Moment

Parameters

  • unitOfTime: string

Returns

Moment

public subtract(input: MomentInput): Moment

Parameters

Returns

Moment

public subtract(unitOfTime: string, amount: number): Moment

Parameters

  • unitOfTime: string
  • amount: number

Returns

Moment

public toDate(): Date

Returns

Date

public toISOString(): string

Returns

string

public unix(): number

Returns

number

public utc(): Moment

Returns

Moment

public valueOf(): number

Returns

number

public week(): number

Returns

number

public week(d: number): Moment

Parameters

  • d: number

Returns

Moment

public weekYear(): number

Returns

number

public weekYear(d: number): Moment

Parameters

  • d: number

Returns

Moment

public weekday(): number

Returns

number

public weekday(d: number): Moment

Parameters

  • d: number

Returns

Moment

public weeks(): number

Returns

number

public weeks(d: number): Moment

Parameters

  • d: number

Returns

Moment

public year(y: number): Moment

Parameters

  • y: number

Returns

Moment

public year(): number

Returns

number

public zone(): number

Returns

number

public zone(b: number): Moment

Parameters

  • b: number

Returns

Moment

public zone(b: string): Moment

Parameters

  • b: string

Returns

Moment