hyperdx
hyperdx copied to clipboard
Customize 24h vs 12h time formatting globally
Some users have a preference for 12h time instead of 24h time, today we do a mix of both depending on the UI they're looking at (sessions is primarily 12h, logs are primarily 24h) - we should allow users to globally toggle 12/24h time and update the time format across the app accordingly.
I've already started a bit of the implementation, but there is still a lot of way to go:
- User preference provider to store preferences (does not persist yet): https://github.com/hyperdxio/hyperdx/blob/main/packages/app/src/useUserPreferences.tsx
- Search time range picker accepting timeFormat as a property and actually using it: https://github.com/hyperdxio/hyperdx/blob/36cbc3ded0dce690a9bb68d72658b8295ca7ef1b/packages/app/src/SearchTimeRangePicker.tsx#L144
Todo:
- Update all time formats around the app in UI components to accept timeFormat as a property
- Update page components to inject timeFormat as a property to UI components (or shortcut this and just read from the provider directly)
- Add UI for user preferences in the settings page somewhere.
- Persist user preferences in localstorage
Hi @MikeShi42 , can give resolving this issue a try?
Sounds good! Let me know if you need any help or pointers :) Feel free to hop in on our Discord if there's some implementations ideas you want to chat about.
I'd also mention we have a hook called useLocalStorage that can help persisting the settings.
Hi @MikeShi42 , just want to let you know I'm still working on this, just needed some time to get familiar with the codebase.
@MikeShi42 Is it completed? I would like to give it a try?