Skip to main content

RQBDateTimeLibraryAPI

Properties

format()

format: (d: DateOrString, fmt: string) => string

Formats a date as a string.

Parameters

ParameterType
dDateOrString
fmtstring

Returns

string

Defined in

datetime/src/types.ts:61


isAfter()

isAfter: (a: DateOrString, b: DateOrString) => boolean

Determines whether the first date is after the second date.

Parameters

ParameterType
aDateOrString
bDateOrString

Returns

boolean

Defined in

datetime/src/types.ts:70


isBefore()

isBefore: (a: DateOrString, b: DateOrString) => boolean

Determines whether the first date is before the second date.

Parameters

ParameterType
aDateOrString
bDateOrString

Returns

boolean

Defined in

datetime/src/types.ts:74


isSame()

isSame: (a: DateOrString, b: DateOrString) => boolean

Determines whether the first date is the same as the second date.

If either the first date or the second date is a string in the format 'YYYY-MM-DD', then the dates will only be compared at the date level (no time component). Otherwise, they will be compared to the millisecond.

Parameters

ParameterType
aDateOrString
bDateOrString

Returns

boolean

Defined in

datetime/src/types.ts:83


isValid()

isValid: (d: DateOrString) => boolean

Determines whether the date is either a valid Date object or an ISO 8601-formatted string representing a valid date.

Parameters

ParameterType
dDateOrString

Returns

boolean

Defined in

datetime/src/types.ts:88


toDate()

toDate: (d: DateOrString) => Date

Converts a string to a Date object or returns a valid Date as is.

Parameters

ParameterType
dDateOrString

Returns

Date

Defined in

datetime/src/types.ts:92


toISOString()

toISOString: (d: DateOrString) => string

Converts a Date or ISO 8601-formatted string into a full ISO 8601 UTC string, in the format 'YYYY-MM-DDTHH:mm:ss.SSSZ' (the "T" and "Z" are static; other parts represent standard time units, increasing in precision from left to right).

Parameters

ParameterType
dDateOrString

Returns

string

Defined in

datetime/src/types.ts:99


toISOStringDateOnly()

toISOStringDateOnly: (d: DateOrString) => string

Formats a date as an ISO 8601 string, only including the year, month, and day ('YYYY-MM-DD').

Parameters

ParameterType
dDateOrString

Returns

string

Defined in

datetime/src/types.ts:66


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.