Opened 10 months ago

Closed 10 months ago

Last modified 10 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, 10 months ago

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

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

comment:2 by Simon Charette, 10 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?

Version 0, edited 10 months ago by Simon Charette (next)
Note: See TracTickets for help on using tickets.
Back to Top