bradymholt / cRonstrue

JavaScript library that translates Cron expressions into human readable descriptions
http://bradymholt.github.io/cRonstrue/
MIT License
1.28k stars 168 forks source link

Incorrect time formats used for various locales #303

Closed lreis closed 10 months ago

lreis commented 10 months ago

Cron Expression 45 16 * * *

Expected Output (pt_BR) "Às 16:45"

Actual Output (pt_BR) "Às 04:45 PM"

Time formats are incorrect for the locales listed below. All with the exception of Belarusian are displaying AM/PM, when they should be using 24-hour format.

Please refer to the comparison table at https://yx86wg.csb.app/ to see the values returned by Intl.DateTimeFormat

It looks like the fix would consist of setting the value of use24HourTimeFormatByDefault() in the corresponding /src/i18n/locales/.ts file to the appropriate value (true is most cases) . I'd be happy to submit a PR if you approve these changes.

bradymholt commented 10 months ago

@KirillMikulich (be), @KhalipskiSiarhei (nb), @rikkapro0128 (vi), as the original authors of some translations can you confirm these languages should use 24 hour time format rather than AM/PM format?

bradymholt commented 10 months ago

@lreis thanks - I'll accept that PR.

lreis commented 10 months ago

@bradymholt thanks - https://github.com/bradymholt/cRonstrue/pull/306

lreis commented 10 months ago

Fixed with v2.43.0