Long time formats for Czech do not include number of hours
See original GitHub issueHello,
it seems that the definition of long time formats for the Czech language (in https://github.com/date-fns/date-fns/blob/master/src/locale/cs/_lib/formatLong/index.ts#L11) uses H
instead of HH
unlike other locales. This then results in weird behavior when switching between languages because strings like 1 hours 15 minutes
change to hour 15 minutes
(in Czech).
This behaviour was encountered in jellyfin-vue that uses date-fns 2.28.0 (https://github.com/jellyfin/jellyfin-vue/blob/master/package.json#L46).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Date and time notation in the Czech Republic - Wikipedia
The Czech Republic hosts two different standardized forms of date and time writing. The Rules of Czech Orthography are mandatory for the educational...
Read more >Dos and Don'ts: Time - Prague, Czech Republic - Expats.cz
In Czech it is půl osmé, i.e., half of the eighth hour. As with the earlier example the word for hour, hodina, is...
Read more >Czech Style Guide - Inflectra Corporation
Additional Long Date. Format 2. N/A. Leading Zero in Day Field for Short Date Format. No ... Time. Country/region. Czech Republic. 24 hour...
Read more >Czech Republic Employment Law - Replicon
The on-call time during which work is not performed shall not be included in working hours. Act No. 262/2006 Coll., Labour Code, §...
Read more >DateTime::Format::CLDR issues parsing long Czech dates
What am I doing wrong? Why does it not parse the date? UPDATE. This is what I have actually been using to test...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hope I won’t sound too aggressive but it should have been asked what are the reasons and use cases for omitting the number, not the other way around (asking why the number should be included). Having a number is the default and never wrong. Not having a number is change from the default and can sometimes be wrong or odd.
Interesting. So, maybe this is just the wrong way to build a localized media duration string? How should a project like Jellyfin approach this problem? Is this a blind spot of
date-fns
that should be considered?@KucharczykL @janziemba could you share some use cases that would require to have or not have the number 1, just so we can document them?
For the sake of comparison, here are all locales using
formatDuration
andIntl.NumberFormat
(❌ indicates no support in Chrome 97, will fallback to system’s default locale)results table
source code