Skip to main content

RQBDateTimeLibraryAPI

Defined in: datetime/src/types.ts:57

Properties

format()

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

Defined in: datetime/src/types.ts:61

Formats a date as a string.

Parameters

ParameterType
dDateOrString
fmtstring

Returns

string


isAfter()

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

Defined in: datetime/src/types.ts:70

Determines whether the first date is after the second date.

Parameters

ParameterType
aDateOrString
bDateOrString

Returns

boolean


isBefore()

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

Defined in: datetime/src/types.ts:74

Determines whether the first date is before the second date.

Parameters

ParameterType
aDateOrString
bDateOrString

Returns

boolean


isSame()

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

Defined in: datetime/src/types.ts:83

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


isValid()

isValid: (d: DateOrString) => boolean

Defined in: datetime/src/types.ts:88

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


toDate()

toDate: (d: DateOrString) => Date

Defined in: datetime/src/types.ts:92

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

Parameters

ParameterType
dDateOrString

Returns

Date


toISOString()

toISOString: (d: DateOrString) => string

Defined in: datetime/src/types.ts:99

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


toISOStringDateOnly()

toISOStringDateOnly: (d: DateOrString) => string

Defined in: datetime/src/types.ts:66

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

Parameters

ParameterType
dDateOrString

Returns

string


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.