Hoist ScheduleOccurrences default time zone to a module constant - #493
Merged
cigamit merged 1 commit intoJun 19, 2026
Merged
Conversation
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
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Follow-up to the
defaultProps→ ES default-parameters conversion (#491), addressing the review suggestion that was deferred to a separate PR.In
ScheduleOccurrences, thetzprop default became:As a
defaultPropsvalue the browser time zone was resolved once at module initialization. As an ES default parameter,Intl.DateTimeFormat().resolvedOptions().timeZonere-runs on every render wheretzis omitted. This hoists the lookup to a module-levelDEFAULT_TIME_ZONEconstant so it is evaluated a single time, restoring the original timing. The resolved value is unchanged.ISSUE TYPE
COMPONENT NAME
ASCENDER VERSION
ADDITIONAL INFORMATION
npm --prefix awx/ui run lintclean;ScheduleOccurrencessuite (4 tests) green.