Skip to content

isValidEpcisTimeZoneOffset

  • Container free time, demurrage, billing deadlines, bill of lading dates and EDI timestamps.
isValidEpcisTimeZoneOffset(value: string): boolean

Return true when value is a GS1 EPCIS 2.0 eventTimeZoneOffset: the UTC offset the local clock ran at where a supply-chain event happened, written ±HH:MM.

  • EPCIS (ISO/IEC 19987) is GS1’s event standard for supply-chain visibility. This is the check isValidEpcisEvent applies to the event’s eventTimeZoneOffset field: that validator calls this one.
  • The value must match epcisTimeZoneOffset, the pattern the EPCIS JSON schema gives: ±HH:MM from -14:00 to +14:00, the rule of EPCIS Standard Release 2.0 §7.4.1 (https://ref.gs1.org/standards/epcis/).
  • The pattern is the whole rule for a string. Every value it matches is an offset Temporal reads, so this validator and epcisTimeZoneOffset.test agree on every string; the validator adds only the answer false for a non-string.
  • Z, +0200, +02, an offset with seconds and an offset past 14:00 are false.
  • -00:00 is true: the GS1 pattern matches it. parseEpcisEvent returns it as +00:00.
  • It need not agree with an offset written in the event’s eventTime. Check that field with isValidEpcisEventTime, or both with isValidEpcisEvent.
ParameterTypeDescription
valuestringcandidate EPCIS eventTimeZoneOffset string

boolean indicating validity

import { isValidEpcisTimeZoneOffset } from "@northguild/gmt/intermodal/validate";
isValidEpcisTimeZoneOffset("-05:00") // true
output 

intermodal/validate/isValidEpcisTimeZoneOffset.ts