-
Notifications
You must be signed in to change notification settings - Fork 0
Allow Selection of "off cycle" DST/non-DST timezones #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b375f74
Initial plan
Copilot 3aa4342
Merge pull request #169 from tsmarvin/develop
tsmarvin 0f8067b
feat: implement off-cycle DST timezone selection feature
Copilot 2477026
refactor: address code review feedback for performance and clarity
Copilot dc31bcf
fix: address code review feedback - improve comment clarity and optim…
Copilot 3d56851
perf: optimize object spread in addTimezone - avoid unnecessary copy …
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -41,6 +41,7 @@ export interface TimeZone { | |||||||||||||||
| abbreviation: string; // Timezone abbreviation (e.g., "EDT", "JST") | ||||||||||||||||
| daylight?: DaylightData; | ||||||||||||||||
| isCustom?: boolean; // Flag to indicate custom timezone | ||||||||||||||||
| isOffCycle?: boolean; // Flag to indicate timezone was manually selected in alternate DST/Standard state (e.g., PST when PDT is current, prevents automatic DST transitions on date changes) | ||||||||||||||||
| coordinates?: { latitude: number; longitude: number }; // Optional coordinates for custom timezones | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -924,7 +925,10 @@ export class TimelineManager { | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| // Initialize modal with callback and selected date | ||||||||||||||||
| this.modal = new TimezoneModal((timezone: TimeZone) => this.addTimezone(timezone), this.selectedDate); | ||||||||||||||||
| this.modal = new TimezoneModal( | ||||||||||||||||
| (timezone: TimeZone, isOffCycle?: boolean) => this.addTimezone(timezone, isOffCycle), | ||||||||||||||||
| this.selectedDate, | ||||||||||||||||
| ); | ||||||||||||||||
|
|
||||||||||||||||
| // Initialize datetime modal with callback | ||||||||||||||||
| this.dateTimeModal = new DateTimeModal((dateTime: Date) => this.setSelectedDate(dateTime)); | ||||||||||||||||
|
|
@@ -958,11 +962,16 @@ export class TimelineManager { | |||||||||||||||
| this.renderTimeline(); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| public addTimezone(timezone: TimeZone): void { | ||||||||||||||||
| public addTimezone(timezone: TimeZone, isOffCycle?: boolean): void { | ||||||||||||||||
| // Check if timezone already exists | ||||||||||||||||
| const exists = this.selectedTimezones.find(tz => tz.iana === timezone.iana); | ||||||||||||||||
| if (!exists) { | ||||||||||||||||
| this.selectedTimezones.push(timezone); | ||||||||||||||||
| // Create a copy of the timezone and set the off-cycle flag if specified | ||||||||||||||||
| const timezoneToAdd: TimeZone = { | ||||||||||||||||
| ...timezone, | ||||||||||||||||
| ...(isOffCycle !== undefined && { isOffCycle }), | ||||||||||||||||
| }; | ||||||||||||||||
|
||||||||||||||||
| const timezoneToAdd: TimeZone = { | |
| ...timezone, | |
| ...(isOffCycle !== undefined && { isOffCycle }), | |
| }; | |
| const timezoneToAdd: TimeZone = isOffCycle !== undefined | |
| ? { ...timezone, isOffCycle } | |
| : timezone; |
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
tsmarvin marked this conversation as resolved.
Show resolved
Hide resolved
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.
Uh oh!
There was an error while loading. Please reload this page.