Skip to content

[Dashboard] Fix dashboard for daylight savings #52755

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 4 commits into from
May 16, 2025

Conversation

bhmiller
Copy link
Contributor

@bhmiller bhmiller commented May 2, 2025

Did not get traction with the holistic fix for daylight savings as there was pushback on usage of tzlocal in python. So, splitting out the fix on the UI side which is perhaps less controversial.

On the UI side, timezone.ts is showing GMT offsets not reflective of daylight savings time. Updating to dynamically pull the offset from Intl.DateTimeFormat. Note not doing any dynamic evaluation so for browser windows open during the switch, it will not update.

Why are these changes needed?

See #51310

Related issue number

Closes #51310

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

My tests are just running the typescript code through https://www.typescriptlang.org/play

Did not get traction with the holistic fix for daylight savings
as there was pushback on usage of tzlocal in python. So,
splitting out the fix on the UI side which is perhaps less
controversial.

On the UI side, `timezone.ts` is showing GMT offsets not reflective
of daylight savings time. Updating to dynamically pull the offset
from `Intl.DateTimeFormat`. Note not doing any dynamic evaluation
so for browser windows open during the switch, it will not update.

Signed-off-by: Brendan Miller <[email protected]>
@bhmiller bhmiller force-pushed the fix-timezone-ui branch 2 times, most recently from a219e89 to 5b01e1f Compare May 5, 2025 15:19
Node.js version used (14) does not seem to implement longOffset.
Use shortOffset instead, and massage the output to be the
same as longOffset.

Signed-off-by: Brendan Miller <[email protected]>
@alanwguo
Copy link
Contributor

alanwguo commented May 6, 2025

Thanks for the fix!

@hainesmichaelc hainesmichaelc added the community-contribution Contributed by the community label May 7, 2025
longOffset vs. shortOffset doesn't matter. It's just for UI
purposes, as formatUtils formatTimeZone takes the time
zone names to derive the display, not offset.

Also fixed match bug where for GMT+0, Intl.DateTimeFormat
only prints "GMT", not e.g. "GMT+0".

Signed-off-by: Brendan Miller <[email protected]>
@bhmiller bhmiller force-pushed the fix-timezone-ui branch from 1d59eb1 to 4ae9959 Compare May 7, 2025 20:05
@masoudcharkhabi masoudcharkhabi added usability observability Issues related to the Ray Dashboard, Logging, Metrics, Tracing, and/or Profiling labels May 12, 2025
@alanwguo alanwguo added the go add ONLY when ready to merge, run all tests label May 14, 2025
@alanwguo
Copy link
Contributor

Thanks for the contribution, merging!

@matthewdeng matthewdeng merged commit 9b3ad79 into ray-project:master May 16, 2025
5 checks passed
@bhmiller bhmiller deleted the fix-timezone-ui branch May 16, 2025 17:19
lk-chen pushed a commit to lk-chen/ray that referenced this pull request May 17, 2025
Did not get traction with the [holistic
fix](ray-project#51314) for daylight savings
as there was pushback on usage of tzlocal in python. So, splitting out
the fix on the UI side which is perhaps less controversial.

On the UI side, `timezone.ts` is showing GMT offsets not reflective of
daylight savings time. Updating to dynamically pull the offset from
`Intl.DateTimeFormat`. Note not doing any dynamic evaluation so for
browser windows open during the switch, it will not update.

---------

Signed-off-by: Brendan Miller <[email protected]>
Co-authored-by: Alan Guo <[email protected]>
vickytsang pushed a commit to ROCm/ray that referenced this pull request Jun 3, 2025
Did not get traction with the [holistic
fix](ray-project#51314) for daylight savings
as there was pushback on usage of tzlocal in python. So, splitting out
the fix on the UI side which is perhaps less controversial.

On the UI side, `timezone.ts` is showing GMT offsets not reflective of
daylight savings time. Updating to dynamically pull the offset from
`Intl.DateTimeFormat`. Note not doing any dynamic evaluation so for
browser windows open during the switch, it will not update.

---------

Signed-off-by: Brendan Miller <[email protected]>
Co-authored-by: Alan Guo <[email protected]>
Signed-off-by: Vicky Tsang <[email protected]>
rebel-scottlee pushed a commit to rebellions-sw/ray that referenced this pull request Jun 21, 2025
Did not get traction with the [holistic
fix](ray-project#51314) for daylight savings
as there was pushback on usage of tzlocal in python. So, splitting out
the fix on the UI side which is perhaps less controversial.

On the UI side, `timezone.ts` is showing GMT offsets not reflective of
daylight savings time. Updating to dynamically pull the offset from
`Intl.DateTimeFormat`. Note not doing any dynamic evaluation so for
browser windows open during the switch, it will not update.

---------

Signed-off-by: Brendan Miller <[email protected]>
Co-authored-by: Alan Guo <[email protected]>
Signed-off-by: Scott Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-backlog community-contribution Contributed by the community go add ONLY when ready to merge, run all tests observability Issues related to the Ray Dashboard, Logging, Metrics, Tracing, and/or Profiling usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Job start and end time are not updated for daylight savings
5 participants