Skip to content
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

Merged

Conversation

Civolilah
Copy link
Collaborator

@Civolilah Civolilah commented Oct 21, 2024

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

Screenshot 2024-10-21 at 19 00 34

Let me know your thoughts.

Closes #2142

@Civolilah Civolilah marked this pull request as ready for review October 21, 2024 17:02
@@ -64,6 +65,22 @@ export function date(date: number | string, format: string) {
return dayjs(date).format(format);
}

export function useFormatTime() {
Copy link
Member

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?

Copy link
Collaborator Author

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 beganovich merged commit 9c2bf00 into invoiceninja:develop Oct 24, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants