Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/pendulum/locales/tr/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"ordinal": {"one": ".", "two": ".", "few": ".", "other": "."},
# Date formats
"date_formats": {
"LTS": "h:mm:ss A",
"LT": "h:mm A",
"L": "MM/DD/YYYY",
"LL": "MMMM D, YYYY",
"LLL": "MMMM D, YYYY h:mm A",
"LLLL": "dddd, MMMM D, YYYY h:mm A",
"LTS": "HH:mm:ss",
"LT": "HH:mm",
"L": "DD.MM.YYYY",
"LL": "D MMMM YYYY",
"LLL": "D MMMM YYYY HH:mm",
"LLLL": "dddd, D MMMM YYYY HH:mm",
},
}
15 changes: 15 additions & 0 deletions tests/localization/test_tr.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ def diff_for_humans():

assert d.diff_for_humans(d2, True, locale=locale) == "1 saniye"
assert d2.diff_for_humans(d.add(seconds=1), True, locale=locale) == "2 saniye"


def test_format():
d = pendulum.datetime(2016, 8, 28, 7, 3, 6, 123456)
assert d.format("dddd", locale=locale) == "Pazar"
assert d.format("ddd", locale=locale) == "Paz"
assert d.format("MMMM", locale=locale) == "Ağustos"
assert d.format("MMM", locale=locale) == "Ağu"
assert d.format("Do", locale=locale) == "28."
assert d.format("LT", locale=locale) == "07:03"
assert d.format("LTS", locale=locale) == "07:03:06"
assert d.format("L", locale=locale) == "28.08.2016"
assert d.format("LL", locale=locale) == "28 Ağustos 2016"
assert d.format("LLL", locale=locale) == "28 Ağustos 2016 07:03"
assert d.format("LLLL", locale=locale) == "Pazar, 28 Ağustos 2016 07:03"