Skip to content

Hoist ScheduleOccurrences default time zone to a module constant - #493

Merged
cigamit merged 1 commit into
ctrliq:mainfrom
blaipr:feature/schedule-occurrences-tz-hoist
Jun 19, 2026
Merged

Hoist ScheduleOccurrences default time zone to a module constant#493
cigamit merged 1 commit into
ctrliq:mainfrom
blaipr:feature/schedule-occurrences-tz-hoist

Conversation

@blaipr

@blaipr blaipr commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
SUMMARY

Follow-up to the defaultProps → ES default-parameters conversion (#491), addressing the review suggestion that was deferred to a separate PR.

In ScheduleOccurrences, the tz prop default became:

tz = Intl.DateTimeFormat().resolvedOptions().timeZone

As a defaultProps value the browser time zone was resolved once at module initialization. As an ES default parameter, Intl.DateTimeFormat().resolvedOptions().timeZone re-runs on every render where tz is omitted. This hoists the lookup to a module-level DEFAULT_TIME_ZONE constant so it is evaluated a single time, restoring the original timing. The resolved value is unchanged.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • UI
ASCENDER VERSION
awx: 25.4.1.dev111+ga2e996cf10
ADDITIONAL INFORMATION
  • npm --prefix awx/ui run lint clean; ScheduleOccurrences suite (4 tests) green.

The `tz` prop default was converted from `defaultProps` to an ES default
parameter (`tz = Intl.DateTimeFormat().resolvedOptions().timeZone`). As a
`defaultProps` value the browser time zone was resolved once at module
load; as a default parameter the `Intl.DateTimeFormat()` lookup re-runs on
every render where `tz` is omitted.

Hoist the lookup to a module-level `DEFAULT_TIME_ZONE` constant so it is
evaluated a single time, preserving the original timing. No behavioural
change to the resolved value.
@cigamit
cigamit merged commit 4a50aa1 into ctrliq:main Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants