Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#35242 closed Bug (needsinfo)

LANGUAGE_CODE = "fr-CA" provide incorrect TIME_FORMAT

Reported by: matisa Owned by: nobody
Component: Internationalization Version: 5.0
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

from django.utils import translation
from django.utils.formats import get_format

# Temporarily activate the "fr-CA" locale
translation.activate('fr-CA')

# Get date and time formats
date_format = get_format('DATE_FORMAT')
time_format = get_format('TIME_FORMAT')
datetime_format = get_format('DATETIME_FORMAT')

print("Date format:", date_format)
Date format: j F Y
print("Time format:", time_format)
Time format: H h i <<<<<< This is wrong
print("Datetime format:", datetime_format)
Datetime format: j F Y, H h i

Change History (2)

comment:1 by matisa, 9 months ago

Overriding the folmat in the settings file does not work either
TIME_FORMAT = "H:i"

Last edited 9 months ago by matisa (previous) (diff)

comment:2 by Simon Charette, 9 months ago

Resolution: needsinfo
Status: newclosed

The correct way to represent time in the fr-CA locale is using h as a separator for hours and minutes.

What source are you using to determine that the format is wrong? Locale was added 6 months ago in 1ac397674b2f64d48e66502a20b9d9ca6bfb579a.

Last edited 9 months ago by Simon Charette (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top