Interface: DateAdapter

Properties

options

Readonly options: unknown

Defined in

adapters.d.ts:6DateAdapter - 图1 (opens new window)

Methods

add

add(timestamp, amount, unit): number

Adds the specified amount of unit to the given timestamp.

Parameters

NameTypeDescription
timestampnumberthe input timestamp
amountnumberthe amount to add
unitTimeUnitthe unit as string

Returns

number

Defined in

adapters.d.ts:34DateAdapter - 图2 (opens new window)


diff

diff(a, b, unit): number

Returns the number of unit between the given timestamps.

Parameters

NameTypeDescription
anumberthe input timestamp (reference)
bnumberthe timestamp to subtract
unitTimeUnitthe unit as string

Returns

number

Defined in

adapters.d.ts:42DateAdapter - 图3 (opens new window)


endOf

endOf(timestamp, unit): number

Returns end of unit for the given timestamp.

Parameters

NameTypeDescription
timestampnumberthe input timestamp
unitTimeUnit | “isoWeek”the unit as string

Returns

number

Defined in

adapters.d.ts:58DateAdapter - 图4 (opens new window)


format

format(timestamp, format): string

Returns the formatted date in the specified format for a given timestamp.

Parameters

NameTypeDescription
timestampnumberthe timestamp to format
formatTimeUnitthe date/time token

Returns

string

Defined in

adapters.d.ts:26DateAdapter - 图5 (opens new window)


formats

formats(): Object

Returns a map of time formats for the supported formatting units defined in Unit as well as ‘datetime’ representing a detailed date/time string.

Returns

Object

Defined in

adapters.d.ts:13DateAdapter - 图6 (opens new window)


override

override(members): void

Parameters

NameType
membersPartial<DateAdapter>

Returns

void

Defined in

adapters.d.ts:5DateAdapter - 图7 (opens new window)


parse

parse(value, format?): number

Parses the given value and return the associated timestamp.

Parameters

NameTypeDescription
valueunknownthe value to parse (usually comes from the data)
format?TimeUnit-

Returns

number

Defined in

adapters.d.ts:19DateAdapter - 图8 (opens new window)


startOf

startOf(timestamp, unit, weekday?): number

Returns start of unit for the given timestamp.

Parameters

NameTypeDescription
timestampnumberthe input timestamp
unitTimeUnit | “isoWeek”the unit as string
weekday?number-

Returns

number

Defined in

adapters.d.ts:51DateAdapter - 图9 (opens new window)