Module

Temporal.Predicate

Package
purescript-temporal
Repository
philippedev101/purescript-temporal

Readable boolean predicates for Temporal types.

These are thin wrappers over Eq/Ord and component getters. They communicate intent better than raw comparison operators.

#sameDay Source

sameDay :: PlainDate -> PlainDate -> Boolean

Whether two dates are the same calendar day.

#sameMonth Source

sameMonth :: PlainDate -> PlainDate -> Boolean

Whether two dates are in the same month and year.

#sameYear Source

sameYear :: PlainDate -> PlainDate -> Boolean

Whether two dates are in the same calendar year.

#isBetweenDates Source

isBetweenDates :: PlainDate -> PlainDate -> PlainDate -> Boolean

Whether a date falls between two bounds (inclusive on both ends).

isBetweenDates (plainDate 2024 3 15) (plainDate 2024 3 1) (plainDate 2024 3 31)

#sameDayDateTime Source

sameDayDateTime :: PlainDateTime -> PlainDateTime -> Boolean

Whether two datetimes fall on the same calendar day.

#isBetweenDateTimes Source

isBetweenDateTimes :: PlainDateTime -> PlainDateTime -> PlainDateTime -> Boolean

Whether a datetime falls between two bounds (inclusive on both ends).

#isBetweenInstants Source

isBetweenInstants :: Instant -> Instant -> Instant -> Boolean

Whether an instant falls between two bounds (inclusive on both ends).