Skip to content

Commit 53a05cf

Browse files
committed
Use Turkish date formats for the tr locale
1 parent e06dace commit 53a05cf

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"ordinal": {"one": ".", "two": ".", "few": ".", "other": "."},
1515
# Date formats
1616
"date_formats": {
17-
"LTS": "h:mm:ss A",
18-
"LT": "h:mm A",
19-
"L": "MM/DD/YYYY",
20-
"LL": "MMMM D, YYYY",
21-
"LLL": "MMMM D, YYYY h:mm A",
22-
"LLLL": "dddd, MMMM D, YYYY h:mm A",
17+
"LTS": "HH:mm:ss",
18+
"LT": "HH:mm",
19+
"L": "DD.MM.YYYY",
20+
"LL": "D MMMM YYYY",
21+
"LLL": "D MMMM YYYY HH:mm",
22+
"LLLL": "dddd, D MMMM YYYY HH:mm",
2323
},
2424
}

‎tests/localization/test_tr.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,18 @@ def diff_for_humans():
6464

6565
assert d.diff_for_humans(d2, True, locale=locale) == "1 saniye"
6666
assert d2.diff_for_humans(d.add(seconds=1), True, locale=locale) == "2 saniye"
67+
68+
69+
def test_format():
70+
d = pendulum.datetime(2016, 8, 28, 7, 3, 6, 123456)
71+
assert d.format("dddd", locale=locale) == "Pazar"
72+
assert d.format("ddd", locale=locale) == "Paz"
73+
assert d.format("MMMM", locale=locale) == "Ağustos"
74+
assert d.format("MMM", locale=locale) == "Ağu"
75+
assert d.format("Do", locale=locale) == "28."
76+
assert d.format("LT", locale=locale) == "07:03"
77+
assert d.format("LTS", locale=locale) == "07:03:06"
78+
assert d.format("L", locale=locale) == "28.08.2016"
79+
assert d.format("LL", locale=locale) == "28 Ağustos 2016"
80+
assert d.format("LLL", locale=locale) == "28 Ağustos 2016 07:03"
81+
assert d.format("LLLL", locale=locale) == "Pazar, 28 Ağustos 2016 07:03"

0 commit comments

Comments
 (0)