Skip to content

Commit cbab60c

Browse files
authored
fix(locale): use Japanese date formats for the ja locale (#977)
Co-authored-by: greymoth <246701683+greymoth-jp@users.noreply.github.com>
1 parent 1d9e31a commit cbab60c

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/pendulum/locales/ja/custom.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"before": "{0} 前",
1414
# Date formats
1515
"date_formats": {
16-
"LTS": "h:mm:ss A",
17-
"LT": "h:mm A",
18-
"L": "MM/DD/YYYY",
19-
"LL": "MMMM D, YYYY",
20-
"LLL": "MMMM D, YYYY h:mm A",
21-
"LLLL": "dddd, MMMM D, YYYY h:mm A",
16+
"LTS": "HH:mm:ss",
17+
"LT": "HH:mm",
18+
"L": "YYYY/MM/DD",
19+
"LL": "YYYY年M月D日",
20+
"LLL": "YYYY年M月D日 HH:mm",
21+
"LLLL": "YYYY年M月D日 dddd HH:mm",
2222
},
2323
}

tests/formatting/test_formatter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ def test_date_formats():
250250
assert f.format(d, "LLL", locale="fr") == "28 août 2016 07:03"
251251
assert f.format(d, "LLLL", locale="fr") == "dimanche 28 août 2016 07:03"
252252

253+
assert f.format(d, "LT", locale="ja") == "07:03"
254+
assert f.format(d, "LTS", locale="ja") == "07:03:06"
255+
assert f.format(d, "L", locale="ja") == "2016/08/28"
256+
assert f.format(d, "LL", locale="ja") == "2016年8月28日"
257+
assert f.format(d, "LLL", locale="ja") == "2016年8月28日 07:03"
258+
assert f.format(d, "LLLL", locale="ja") == "2016年8月28日 日曜日 07:03"
259+
253260

254261
def test_escape():
255262
f = Formatter()

0 commit comments

Comments
 (0)