Skip to content

isBeforeDate

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

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

  • Uses Temporal.PlainDate.compare to compare dates.
  • Returns false if either input is invalid.
ParameterTypeDescription
value1stringISO PlainDate string for the first value
value2stringISO PlainDate string for the second value

boolean indicating whether value1 < value2

import { isBeforeDate } from "@northguild/gmt/plain/compare";
isBeforeDate("2024-02-28", "2024-02-29") // true
output 

plain/compare/isBeforeDate.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.