Hyperlinkv0.8.0-beta.28

DateTime

DateTime.isLessThanconsteffect/DateTime.ts:1369
(that: DateTime): (self: DateTime) => boolean
(self: DateTime, that: DateTime): boolean

Checks whether the first DateTime is before the second DateTime.

Example (Checking whether a DateTime is earlier)

import { DateTime } from "effect"

const date1 = DateTime.makeUnsafe("2024-01-01")
const date2 = DateTime.makeUnsafe("2024-02-01")

console.log(DateTime.isLessThan(date1, date2)) // true
console.log(DateTime.isLessThan(date2, date1)) // false
comparisons
export const isLessThan: {
  (that: DateTime): (self: DateTime) => boolean
  (self: DateTime, that: DateTime): boolean
} = Internal.isLessThan