Skip to content

isBeforeDateTime

  • The core functions, which every industry uses.
isBeforeDateTime(value1: string, value2: string): boolean

Return true when value1 is strictly before value2 for PlainDateTime values.

  • Uses Temporal.PlainDateTime.compare to compare date-times.
  • Returns false if either input is invalid.
ParameterTypeDescription
value1stringISO PlainDateTime string for the first value
value2stringISO PlainDateTime string for the second value

boolean indicating whether value1 < value2

import { isBeforeDateTime } from "@northguild/gmt/plain/compare";
isBeforeDateTime("2024-02-28T12:34:56", "2024-02-29T12:34:56") // true
output 

plain/compare/isBeforeDateTime.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.