Zone to validate
true if the zone is valid and usable (type guard)
const zone = Info.normalizeZone("America/Los_Angeles")
if (isZoneValid(zone)) {
// TypeScript knows zone is Zone (not Zone | undefined)
console.log(zone.name)
}
isZoneValid(Info.normalizeZone("invalid")) // false
isZoneValid(Info.normalizeZone("UTC+8")) // true
isZoneValid(UnsetZone) // false
isZoneValid(Info.normalizeZone("UTC+20")) // false (beyond ±14 hours)
Type guard to check if a Zone is valid and usable.
A zone is considered valid if it:
isValid === true(Luxon requirement)This is the canonical validation check used throughout the library.