diff --git a/elm-package.json b/elm-package.json index 3f4b39a..712760d 100644 --- a/elm-package.json +++ b/elm-package.json @@ -27,6 +27,7 @@ "Date.Extra.I18n.I_ja_jp", "Date.Extra.I18n.I_de_de", "Date.Extra.I18n.I_ru_ru", + "Date.Extra.I18n.I_tr_tr", "Date.Extra.Config.Configs", "Date.Extra.Config.Config_en_au", "Date.Extra.Config.Config_en_us", @@ -41,6 +42,7 @@ "Date.Extra.Config.Config_ja_jp", "Date.Extra.Config.Config_de_de", "Date.Extra.Config.Config_ru_ru", + "Date.Extra.Config.Config_tr_tr", "Date.Extra.Field" ], "dependencies": { diff --git a/src/Date/Extra/Utils.elm b/src/Date/Extra/Utils.elm index 5cf3a04..6bb54d9 100644 --- a/src/Date/Extra/Utils.elm +++ b/src/Date/Extra/Utils.elm @@ -46,6 +46,9 @@ starting from startDate. Now adds 1 day if dayCount is +ve to create day list. Now subtracts 1 day if dayCount is -ve to create day list. +This could be made much faster by using `daysFromCivil` +and not using underlying date system at all I believe. + -} dayList : Int -> Date -> List Date dayList dayCount startDate = diff --git a/tests/Date/Extra/ConfigTests.elm b/tests/Date/Extra/ConfigTests.elm index af845e6..ee0ddbe 100644 --- a/tests/Date/Extra/ConfigTests.elm +++ b/tests/Date/Extra/ConfigTests.elm @@ -16,6 +16,7 @@ import Date.Extra.Config.Config_et_ee as Config_et_ee import Date.Extra.Config.Config_ja_jp as Config_ja_jp import Date.Extra.Config.Config_ru_ru as Config_ru_ru import Date.Extra.Config.Config_de_de as Config_de_de +import Date.Extra.Config.Config_tr_tr as Config_tr_tr import Date.Extra.Config.Configs as Configs @@ -71,6 +72,10 @@ config_de_de = Config_de_de.config +config_tr_tr = + Config_tr_tr.config + + tests : Test tests = describe "Date.Config tests" @@ -149,4 +154,9 @@ tests = Expect.equal config_de_de.format (Configs.getConfig "de_de").format + , test "getConfig tr_tr" <| + \() -> + Expect.equal + config_tr_tr.format + (Configs.getConfig "tr_tr").format ] diff --git a/tests/Date/Extra/FormatTests.elm b/tests/Date/Extra/FormatTests.elm index 3c9475e..072334d 100644 --- a/tests/Date/Extra/FormatTests.elm +++ b/tests/Date/Extra/FormatTests.elm @@ -21,6 +21,7 @@ import Date.Extra.Config.Config_et_ee as Config_et_ee import Date.Extra.Config.Config_ja_jp as Config_ja_jp import Date.Extra.Config.Config_ru_ru as Config_ru_ru import Date.Extra.Config.Config_de_de as Config_de_de +import Date.Extra.Config.Config_tr_tr as Config_tr_tr import Date.Extra.Period as DPeriod exposing (Period(Hour)) @@ -76,6 +77,10 @@ config_de_de = Config_de_de.config +config_tr_tr = + Config_tr_tr.config + + tests : Test tests = describe "Date.Format tests" @@ -268,6 +273,8 @@ formatConfigTestCases = , ( "Config_ru_ru time idiom", "05:53", config_ru_ru, config_ru_ru.format.time, aTestTime5 ) , ( "Config_de_de date idiom", "5. August 2014", config_de_de, config_de_de.format.date, aTestTime5 ) , ( "Config_de_de longDate idiom", "Dienstag, 5. August 2014", config_de_de, config_de_de.format.longDate, aTestTime5 ) + , ( "Config_tr_tr date idiom", "05.08.2014", config_tr_tr, config_tr_tr.format.date, aTestTime5 ) + , ( "Config_tr_tr longDate idiom", "05 Ağustos 2014 Salı", config_tr_tr, config_tr_tr.format.longDate, aTestTime5 ) ]