Hyperlinkv0.8.0-beta.28

DateTime

DateTime.isGreaterThanconsteffect/DateTime.ts:1321
(that: DateTime): (self: DateTime) => boolean
(self: DateTime, that: DateTime): boolean

Checks whether the first DateTime is after the second DateTime.

Example (Checking whether a DateTime is later)

import { DateTime } from "effect"

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

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