ntfy
ntfy copied to clipboard
Format Date per user locale
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
In the Android app? It should be using the user locale. Or are you talking about the web app?
Yeah the web app
@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?
I was hoping for an option in the settings to change the format.
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