Skip to content

Commit 2fbd687

Browse files
authored
[verified] fix: correct Hindi date formats (#964)
1 parent 4b7a41d commit 2fbd687

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎src/pendulum/locales/hi/custom.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"date_formats": {
1414
"LTS": "h:mm:ss A",
1515
"LT": "h:mm A",
16-
"L": "MM/DD/YYYY",
17-
"LL": "MMMM D, YYYY",
18-
"LLL": "MMMM D, YYYY h:mm A",
19-
"LLLL": "dddd, MMMM D, YYYY h:mm A",
16+
"L": "DD/MM/YYYY",
17+
"LL": "D MMMM YYYY",
18+
"LLL": "D MMMM YYYY h:mm A",
19+
"LLLL": "dddd, D MMMM YYYY h:mm A",
2020
},
2121
}

‎tests/localization/test_hi.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ def diff_for_humans():
6767

6868
assert d.diff_for_humans(d2, True, locale=locale) == "कुछ सेकंड"
6969
assert d2.diff_for_humans(d.add(seconds=1), True, locale=locale) == "कुछ सेकंड"
70+
71+
72+
def test_date_formats():
73+
d = pendulum.datetime(2016, 8, 29, 7, 3, 6, 123456)
74+
assert d.format("L", locale=locale) == "29/08/2016"
75+
assert d.format("LL", locale=locale) == "29 अगस्त 2016"
76+
assert d.format("LLL", locale=locale) == "29 अगस्त 2016 7:03 AM"
77+
assert d.format("LLLL", locale=locale) == "सोमवार, 29 अगस्त 2016 7:03 AM"

0 commit comments

Comments
 (0)