Stop using ordinal numbers in English date represenation (Z#23210534) (#5539)

* Stop using ordinal numbers in English date represenation (Z#23210534)

* ADjust more tests
This commit is contained in:
Raphael Michel
2025-10-15 09:06:54 +02:00
committed by GitHub
parent 40357681df
commit 6190b93f89
10 changed files with 78 additions and 78 deletions

View File

@@ -76,11 +76,11 @@ def daterange(df, dt, as_html=False):
return format_html(base_format, _date(df, "j F"), until, _date(dt, "j F Y"))
elif lng.startswith("en"):
if df.year == dt.year and df.month == dt.month and df.day == dt.day:
return format_html(base_format, _date(df, "D, N jS, Y"))
return format_html(base_format, _date(df, "D, N j, Y"))
elif df.year == dt.year and df.month == dt.month:
return format_html(base_format, _date(df, "N jS"), until, _date(dt, "jS, Y"))
return format_html(base_format, _date(df, "N j"), until, _date(dt, "j, Y"))
elif df.year == dt.year:
return format_html(base_format, _date(df, "N jS"), until, _date(dt, "N jS, Y"))
return format_html(base_format, _date(df, "N j"), until, _date(dt, "N j, Y"))
elif lng.startswith("es"):
if df.year == dt.year and df.month == dt.month and df.day == dt.day:
return format_html(base_format, _date(df, "DATE_FORMAT"))

View File

@@ -38,5 +38,5 @@ SHORT_DATE_FORMAT = 'Y-m-d'
SHORT_DATETIME_FORMAT = 'Y-m-d H:i'
TIME_FORMAT = 'H:i'
WEEK_FORMAT = '\\W W, o'
WEEK_DAY_FORMAT = 'D, M jS'
WEEK_DAY_FORMAT = 'D, M j'
SHORT_MONTH_DAY_FORMAT = 'd.m.'

View File

@@ -38,7 +38,7 @@ SHORT_DATE_FORMAT = "Y-m-d"
SHORT_DATETIME_FORMAT = 'Y-m-d P'
TIME_FORMAT = 'P'
WEEK_FORMAT = '\\W W, o'
WEEK_DAY_FORMAT = 'D, M jS'
WEEK_DAY_FORMAT = 'D, M j'
SHORT_MONTH_DAY_FORMAT = 'm/d'
DATE_INPUT_FORMATS = [

View File

@@ -25,7 +25,7 @@ SHORT_DATE_FORMAT = 'm/d/Y'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
TIME_FORMAT = 'P'
WEEK_FORMAT = '\\W W, o'
WEEK_DAY_FORMAT = 'D, M jS'
WEEK_DAY_FORMAT = 'D, M j'
SHORT_MONTH_DAY_FORMAT = 'm/d'
DATE_INPUT_FORMATS = [