Checks if the given two intervals are overlapping.
By default, it returns true
if the end of one interval is exactly same time to the start of the other interval.
You can pass the inclusive
option to change this behavior.
Similar to Array
, but with union distribution; ArrayOf<A | B>
is A[] | B[]
, not (A|B)[]
.
Returns a datetime object clamped within the given interval.
Returns an index of the closest datetime object to the given datetime object from the passed array.
Returns the closest datetime object to the given datetime object from the passed array.
Compares two datetime objects in chronological order and returns -1, 0, or 1.
Compares two datetime objects in reverse chronological order and returns -1, 0, or 1.
Returns the earliest of the given datetime objects.
Returns the end of a day for the given datetime
Returns the end of a hour for the given datetime
Returns the end of a minute for the given datetime
Returns the end of a month for the given datetime
Returns the end of a second for the given datetime
Returns the end of a year for the given datetime
Returns an integer of seconds from Unix epoch until the exact time which the given temporal object represents.
Returns a string in RFC 7231's format which represents an exact time of given temporal object. Units smaller than second are ignored (rounded down).
Returns formatted date string of the Temporal object in the given format.
When formatting year, month, or day, this function only accepts a temporal object with ISO calendar by default.
If you are 100% sure what you are doing and want to format numeric date info of non-ISO date intentionally,
pass formatNonIsoDate
option.
Creates Temporal object from datetime string in RFC 2822's format.
Creates Temporal object from datetime string in RFC 7231's format (HTTP date format)
such as Mon, 01 Jan 2024 01:23:45 GMT
.
This function doesn't support obsoleted formats.
Date
or extended Date
The object which represents an interval. start
and end
should have the same type.
Checks whether the first datetime is after the second one.
Checks whether the first datetime is before the second one.
Checks whether the given datetime is within the interval.
Returns the julian day of the exact time which the given temporal object represents.
Returns the latest of the given datetime objects.
Returns the start of a day for the given datetime
Returns the start of a hour for the given datetime
Returns the start of a minute for the given datetime
Returns the start of a month for the given datetime
Returns the start of a second for the given datetime
Returns the start of a year for the given datetime
Returns Date
which represents clock (local) time of given temporal object,
dropping timezone and calendar information.
When you pass ZonedDateTime
, clock time will be unchanged but exact time will change.
This function is useful when you want to use formatting functions of date-fns.
Returns Temporal instance which represents clock (local) time of given date.