-
Notifications
You must be signed in to change notification settings - Fork 4
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
Timezone Control in the GUIDE #820
Merged
Merged
Changes from 2 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
9a8bc6e
Allow user to specify a timezone to use in the GUIDE
garrettmflynn 5b826f5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4dc776f
Generate timezone list
garrettmflynn ad1cf97
Merge branch 'main' into timezone
CodyCBakerPhD 303e275
Provide datetime values with a timezone offset specified. Render diff…
garrettmflynn ad1e9c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 31b5fec
More uniform time handling
garrettmflynn 977950f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f521e57
Extract timezone offset using timezone awareness. Remove timezone awa…
garrettmflynn 3681429
Merge branch 'timezone' of https://github.com/NeurodataWithoutBorders…
garrettmflynn 4c69fab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a195173
Set timezone when converting data
garrettmflynn 7af0222
Add timestamp awareness to forms and conversion process
garrettmflynn 3e74935
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fae3596
Ensure default values are carried in the preform
garrettmflynn 864c2da
Merge branch 'timezone' of https://github.com/NeurodataWithoutBorders…
garrettmflynn 9b7eb71
Merge branch 'main' into timezone
CodyCBakerPhD 5beaafe
Merge branch 'main' into timezone
CodyCBakerPhD 389c113
Use keywords, categories, and labels to improve the rendering of time…
garrettmflynn d026cd8
Merge branch 'timezone' of https://github.com/NeurodataWithoutBorders…
garrettmflynn 74856c9
Require timezone and move workflow value resolution into the Dashboar…
garrettmflynn f868b1e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ca3ea2d
Update Dashboard.js
garrettmflynn 720fe30
Merge branch 'timezone' of https://github.com/NeurodataWithoutBorders…
garrettmflynn d0d49c1
Add non-category timezone information to the end
garrettmflynn ed416e1
Show long and short name
garrettmflynn 7042094
Instead of always including UTC, add it if the timezone detector has …
garrettmflynn fa29aa4
Properly resolve promises
garrettmflynn b619ce3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f02a800
Bring dashboard changes directly from the backend configuration PR
garrettmflynn bf96a46
Update Dashboard.js
garrettmflynn 28bc090
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 90fa005
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] aad5e9a
Merge branch 'main' into timezone
CodyCBakerPhD b82875d
Rely on Python for timezone information
garrettmflynn c9370ad
Update GuidedMetadata.js
garrettmflynn 75e2f79
Merge branch 'main' into timezone
garrettmflynn c8a69fc
Update GuidedSourceData.js
garrettmflynn 6476daf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b3fc871
cleanup modules
CodyCBakerPhD 6d03f2e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 48d8e76
add call to management helpers
CodyCBakerPhD 051bbd5
Merge remote-tracking branch 'origin/timezone' into timezone
CodyCBakerPhD b440644
remove placeholder
CodyCBakerPhD 5f948c9
object does not mutate
CodyCBakerPhD eaf29a1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8e1b835
adjust fetch calls
CodyCBakerPhD 987e1b2
fix namespace for docs
CodyCBakerPhD b75e55d
debug import
CodyCBakerPhD 6bd7823
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d3ba6d1
fix import and parse datetime object
CodyCBakerPhD d2bec56
Merge remote-tracking branch 'origin/timezone' into timezone
CodyCBakerPhD 3180bc3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 10aa18b
Sort by category
garrettmflynn 0cc837c
Update timezone.schema.ts
garrettmflynn 37d75d6
Add current timezone if filtered out (e.g. in Actions)
garrettmflynn 1006ac0
Merge branch 'main' into timezone
CodyCBakerPhD 518dd96
Fix workflow loading. Add localstorage data handling back on the web
garrettmflynn aaaeef7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4f3056f
Fix preform page. Add multi-session workflow to show other pages
garrettmflynn 8473378
Merge branch 'timezone' of https://github.com/NeurodataWithoutBorders…
garrettmflynn 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 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
// const timezones = Intl.supportedValuesOf('timeZone'); | ||
|
||
const mostCommonTimezonesWithUTCOffset = { | ||
'Pacific/Honolulu': '-10:00', | ||
'America/Anchorage': '-09:00', | ||
'America/Los_Angeles': '-08:00', | ||
'America/Denver': '-07:00', | ||
'America/Chicago': '-06:00', | ||
'America/New_York': '-05:00', | ||
'America/Sao_Paulo': '-03:00', | ||
'Atlantic/Azores': '-01:00', | ||
'Europe/London': '+00:00', | ||
'Europe/Paris': '+01:00', | ||
'Europe/Athens': '+02:00', | ||
'Asia/Jerusalem': '+02:00', | ||
'Europe/Moscow': '+03:00', | ||
'Asia/Dubai': '+04:00', | ||
'Asia/Karachi': '+05:00', | ||
'Asia/Dhaka': '+06:00', | ||
'Asia/Jakarta': '+07:00', | ||
'Asia/Shanghai': '+08:00', | ||
'Asia/Tokyo': '+09:00', | ||
'Australia/Sydney': '+10:00', | ||
'Pacific/Auckland': '+12:00' | ||
}; | ||
garrettmflynn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
export const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; | ||
|
||
export default { | ||
type: "string", | ||
description: "Provide a base timezone for all date and time operations in the GUIDE.", | ||
default: localTimeZone, | ||
enum: Object.keys(mostCommonTimezonesWithUTCOffset), | ||
enumLabels: Object.entries(mostCommonTimezonesWithUTCOffset).reduce((acc, [ name, offset ]) => { | ||
acc[name] = `${name} (${offset})` | ||
return acc | ||
}), | ||
strict: true | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is likely to confuse people due to daylight savings time. Most of these timezone names actually have different offsets depending on the day of the year. zoneinfo takes care of this automatically- you input the name of the timezone and it will check the date so that the correct offset is applied. I wish we could apply a simplifying approach like this but honestly I think this is going to confuse a lot of people if implemented this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly think a very long dropdown would be better. I know it's not ideal but it is at least accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed the option where we are rendering the browser's acceptable timezones as a native
<select>
element.How's this? Would you prefer it to be searchable? What about the formats used by
zoneinfo
that aren't inAmerica/Chicago
format?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach would absolutely need to be searchable (probably as our loose selector); it's overwhelming scrolling through a list that massive
I'd still recommend we simplify with a basic numeric scroller, that's many fewer options and removes the complexity of tying the number to a specific place (which has a somewhat low chance of being exactly the city they are located in)