-
Notifications
You must be signed in to change notification settings - Fork 49
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
[Bugfix] Time Formatting #2145
[Bugfix] Time Formatting #2145
Conversation
src/common/helpers.ts
Outdated
@@ -64,6 +65,22 @@ export function date(date: number | string, format: string) { | |||
return dayjs(date).format(format); | |||
} | |||
|
|||
export function useFormatTime() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a duplicate of useDateTime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beganovich Actually, it's not a duplicate because useFormatTime
is dedicated only to formatting time values, while useDateTime
formats the full date + time
. However, since you mentioned it, I believe it's better to have it under useDateTime
so we can make it more global. So, I've modified the useDateTime
hook to accept time-only formatting. Let me know your thoughts.
@beganovich @turbo124 The PR includes formatting of times in the app when we display them. Wherever I found a fixed time format, I replaced it with a dynamic one relying on the
military_time
company settings property. Screenshot:Let me know your thoughts.
Closes #2142