Open shalak opened 1 year ago
This is interesting, I'm on Fedora and my system time format is 24h format but all my signal time stamps are in 12h, not just the "More Info"
Electron does not give us access to time-specific user settings, see: https://github.com/signalapp/Signal-Desktop/issues/4252, but we should be formatting times based on the locale & language of the system.
I'm guessing in this case that the region & language might be conflicting in terms of time formatting -- @shalak would you be willing to share your system region & preferred languages?
Sure, here you go:
And your guess was correct - when I change the preferred language to Polish, I'm getting 24h format.
The app seems to have a few different ways of formatting dates.
formatTimestamp
function, which uses the locale from the Electron API getPreferredSystemLanguages
function.formatTime
function, which uses new Date().toLocaleTimeString()
internally.new Date().toLocaleDateString
or new Date().toLocaleTimeString()
which uses the locale from the browser API. I believe this is done using the value from navigator.languages
.https://www.electronjs.org/docs/latest/api/app#appgetpreferredsystemlanguages https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString
I think the fix here is to replace the usage of new Date().toLocaleTimeString
and new Date().toLocaleDateString
with a call to formatTimestamp
, so that everything uses the language as determined by Electron.
Bug Description
The "More info" screen of given message shows 12h format, even though in every other place of Signal app (and the OS itself) I have 24h format.
Steps to Reproduce
Actual Result:
The 12h time format is shown
Expected Result:
Time format is consistent with other places of app (and OS) (i.e. 24h)
Screenshots
Platform Info
Signal Version:
6.16.0 production (Apple silicon)
Operating System:
MacOS Ventura 13.2.1 (22D68)
Linked Device Version:
Andorid 6.19.6, although this is not applicable, as the mobile version of app doesn't have this bug.
Link to Debug Log
N/A