[GH-ISSUE #475] Format Date per user locale #361

Closed
opened 2026-05-07 00:23:30 +02:00 by BreizhHardware · 5 comments

Originally created by @omar2205 on GitHub (Nov 8, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/475

To have the date as 11/8/22, 2:58 PM is very American. Can you please convert it to user locale? or an option in settings

Originally created by @omar2205 on GitHub (Nov 8, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/475 To have the date as `11/8/22, 2:58 PM` is very American. Can you please convert it to user locale? or an option in settings
BreizhHardware 2026-05-07 00:23:30 +02:00
Author
Owner

@binwiederhier commented on GitHub (Nov 8, 2022):

In the Android app? It should be using the user locale. Or are you talking about the web app?

<!-- gh-comment-id:1307717674 --> @binwiederhier commented on GitHub (Nov 8, 2022): In the Android app? It should be using the user locale. Or are you talking about the web app?
Author
Owner

@omar2205 commented on GitHub (Nov 9, 2022):

Yeah the web app

<!-- gh-comment-id:1308142868 --> @omar2205 commented on GitHub (Nov 9, 2022): Yeah the web app
Author
Owner

@binwiederhier commented on GitHub (Nov 27, 2022):

@omar2205 So I checked the code and message dates are formatted using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat, in this function:

export const formatShortDateTime = (timestamp) => {
    return new Intl.DateTimeFormat('default', {dateStyle: 'short', timeStyle: 'short'})
        .format(new Date(timestamp * 1000));
}

The docs say that using default is using the browser's default locale. I tested this by switching my Firefox to German, and the date format switched to the German date format as well.

@omar2205 Can you elaborate what browser you are using, and what your language settings in the browser are? Maybe show screenshots?

<!-- gh-comment-id:1328295385 --> @binwiederhier commented on GitHub (Nov 27, 2022): @omar2205 So I checked the code and message dates are formatted using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat, in this function: ``` export const formatShortDateTime = (timestamp) => { return new Intl.DateTimeFormat('default', {dateStyle: 'short', timeStyle: 'short'}) .format(new Date(timestamp * 1000)); } ``` The docs say that using `default` is using the browser's default locale. I tested this by switching my Firefox to German, and the date format switched to the German date format as well. @omar2205 Can you elaborate what browser you are using, and what your language settings in the browser are? Maybe show screenshots?
Author
Owner

@omar2205 commented on GitHub (Nov 27, 2022):

I was hoping for an option in the settings to change the format.

<!-- gh-comment-id:1328305486 --> @omar2205 commented on GitHub (Nov 27, 2022): I was hoping for an option in the settings to change the format.
Author
Owner

@KhaaL commented on GitHub (Jan 22, 2024):

Hi! I see this is implemented via https://github.com/binwiederhier/ntfy/issues/700 - but I see no setting to adjust the date format on the webapp on ntfy.sh. Is this feature only visible for self-hosted versions? There is no mention of this feature beyond the release notes for v. 2.7.0

<!-- gh-comment-id:1904313615 --> @KhaaL commented on GitHub (Jan 22, 2024): Hi! I see this is implemented via https://github.com/binwiederhier/ntfy/issues/700 - but I see no setting to adjust the date format on the webapp on ntfy.sh. Is this feature only visible for self-hosted versions? There is no mention of this feature beyond the release notes for [v. 2.7.0](https://docs.ntfy.sh/releases/?h=date#ntfy-server-v270)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#361
No description provided.