Update UTC time to local time
Fixes: #issue Only UTC time shown in UI (mainly Round Manager) https://github.com/orgs/gitcoinco/projects/13/views/23?filterQuery=time&pane=issue&itemId=29281048
Description
Adds function to retrieve local timezone shorthand (e.g. "EDT"), and adds it to local-determined time in a way that as closely mirrors the existing UTC approach as possible. Did not remove existing UTC methods, only replaced their references in the UI and testcase.
Checklist
This PR:
- [ ] Does it add new payout or donation token? In this case, have they been added to the indexer to avoid it to crash?
- [x] Includes only changes relevant to the original ticket. Significant refactoring needs to be separated.
- [x] Doesn't disable eslint rules.
- [x] Doesn't work around the type checker (including but not limited to: type casts, non-null assertions,
@ts-ignore, unjustified optional values). - [x] Doesn't contain commented out code.
- [ ] If adding/updating a feature, it adds/updates its test script on Notion.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| builder | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
| builder-staging | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
| explorer | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
| explorer-staging | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
| manager | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
| manager-staging | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 13, 2024 9:49pm |
@MasterHW @melissa-neira Currently when you set the time, it was always in UTC Just wanted to double check that the expected behaviour is :
- When I set the time -> i use UTC (this is what contract uses)
- When i view the time on page -> it is displayed in local time zone
- When I edit the time -> I use UTC again
@michellema1208 @thelostone-mc converted round creator page to also use local time - removed UTC references, and contract should be getting the local time. I've tested this on my end but would feel better if one of you verified as well.
@MasterHW the edit round page is looking good! It looks like the time zone is omitted in round setup, could we list it so that it matches settings?