grants-stack icon indicating copy to clipboard operation
grants-stack copied to clipboard

Update UTC time to local time

Open MasterHW opened this issue 1 year ago • 4 comments

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.

MasterHW avatar Apr 18 '24 22:04 MasterHW

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

vercel[bot] avatar Apr 18 '24 22:04 vercel[bot]

@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
image image

thelostone-mc avatar Apr 23 '24 12:04 thelostone-mc

@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 avatar Apr 25 '24 17:04 MasterHW

@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? Screenshot 2024-04-26 at 11 03 57 AM

meglister avatar Apr 26 '24 15:04 meglister