[ENHANCEMENT] Display GMT offset next to time range selector#106
[ENHANCEMENT] Display GMT offset next to time range selector#106DeeBi9 wants to merge 5 commits into
Conversation
Signed-off-by: Deepanshu Bisht <deepanshudb1@gmail.com>
Signed-off-by: Deepanshu Bisht <deepanshudb1@gmail.com>
| onClick={() => setOpen(!open)} | ||
| IconComponent={Calendar} | ||
| renderValue={() => ( | ||
| <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}> |
There was a problem hiding this comment.
We can use a Stack instead
| const browserOffset = getGMTOffset('browser'); | ||
|
|
||
| expect(localOffset).toContain('GMT'); | ||
| expect(browserOffset).toContain('GMT'); |
There was a problem hiding this comment.
it seems that we are not asserting correctly what the offset should be
There was a problem hiding this comment.
YEs, I will update this too shortly
|
Thanks for the PR 😄 I think this feature may need some reflections:
|
| [value, timeZone] | ||
| ); | ||
|
|
||
| const selectedDisplay = useMemo(() => { |
There was a problem hiding this comment.
we probably don't need this as the value is passed to the renderValue function and we can use formatTimeRange(value, timeZone) directly
There was a problem hiding this comment.
should we preserve descriptive labels like "Last x minutes/hours", or is the formatted value sufficient?
|
@DeeBi9 thnx for your contribution, apart from other comments there seem to be lint and formatting issues, mind checking? |
To address space , we could use one approach that to only display the timezone indicator when it differs from local. That way it avoids adding noise for users who always use local time. I used GMT offset because it was suggested in the issue, but we could also consider 'region-based' representation. Whatever best aligns with UI. |
Sure I will check and fix that. |
Signed-off-by: Deepanshu Bisht <deepanshudb1@gmail.com>
Signed-off-by: Deepanshu Bisht <deepanshudb1@gmail.com>
Signed-off-by: Deepanshu Bisht <deepanshudb1@gmail.com>
Description
Display the active timezone as a GMT offset alongside the time range selector.
This PR only introduces a visual indicator and does not modify timezone persistence behavior.
Closes perses/perses#3941
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: