Skip to content

Add IANA timezone validation constraint (IGO-35)#104

Draft
strider2038 wants to merge 1 commit into
mainfrom
cursor/timezone-constraint-4ccb
Draft

Add IANA timezone validation constraint (IGO-35)#104
strider2038 wants to merge 1 commit into
mainfrom
cursor/timezone-constraint-4ccb

Conversation

@strider2038

Copy link
Copy Markdown
Contributor

Summary

Adds IANA timezone validation aligned with Symfony Timezone:

  • it.IsTimezone() with optional WithZone() regional filter
  • validate.Timezone() with WithTimezoneZone() and TimezoneZone* constants
  • is.Timezone() boolean helper
  • validation.ErrInvalidTimezone with English and Russian translations

Validation uses time.LoadLocation and accepts canonical IANA identifiers (UTC or Region/City). Implementation-specific names (Local, Factory) and bare abbreviations (EST, GMT) are rejected.

Also closes IGO-33 (Currency) in Linear — already implemented in the codebase.

Test plan

  • go test -race ./...
  • golangci-lint run
  • Integration cases in test/constraints_date_time_test.go
  • Unit tests in validate/timezone_test.go
  • Examples in it/example_test.go, validate/example_test.go, is/example_test.go
Open in Web Open in Cursor 

Implement it.IsTimezone with optional WithZone regional filter,
validate.Timezone, and is.Timezone aligned with Symfony Timezone.
Uses time.LoadLocation and rejects non-IANA names like Local and EST.

Co-authored-by: Igor Lazarev <strider2038@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants