forked from bitwalker/timex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lformat wrong on AM/PM cases in locale tr (bitwalker#698)
* Fix i18n for day_periods * Add test case about %P and %p on locale tr
- Loading branch information
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule DateFormatTest.LFormatStrftime do | ||
use ExUnit.Case, async: true | ||
use Timex | ||
|
||
@aug182013_am Timex.to_datetime({{2013, 8, 18}, {11, 00, 5}}) | ||
@aug182013_pm Timex.to_datetime({{2013, 8, 18}, {12, 30, 5}}) | ||
|
||
describe "locale tr" do | ||
test "lformat %P" do | ||
formatter = Timex.Format.DateTime.Formatters.Strftime | ||
|
||
assert {:ok, "öö"} = formatter.lformat(@aug182013_am, "%P", "tr") | ||
assert {:ok, "ÖÖ"} = formatter.lformat(@aug182013_am, "%p", "tr") | ||
assert {:ok, "ös"} = formatter.lformat(@aug182013_pm, "%P", "tr") | ||
assert {:ok, "ÖS"} = formatter.lformat(@aug182013_pm, "%p", "tr") | ||
end | ||
end | ||
end |