-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from decafbad/master
Start of Turkish support
- Loading branch information
Showing
3 changed files
with
208 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module Date.Extra.Config.Config_tr_tr exposing (..) | ||
|
||
{-| This is the default Turkish config for formatting dates. | ||
@docs config | ||
Copyright (c) 2017 Mehmet Köse | ||
-} | ||
|
||
import Date | ||
import Date.Extra.Config as Config | ||
import Date.Extra.I18n.I_tr_tr as Turkish | ||
|
||
|
||
{-| Config for en-us. | ||
-} | ||
config : Config.Config | ||
config = | ||
{ i18n = | ||
{ dayShort = Turkish.dayShort | ||
, dayName = Turkish.dayName | ||
, monthShort = Turkish.monthShort | ||
, monthName = Turkish.monthName | ||
, dayOfMonthWithSuffix = Turkish.dayOfMonthWithSuffix | ||
} | ||
, format = | ||
{ date = | ||
"%d.%m.%Y" | ||
|
||
, longDate = | ||
"%d %B %Y %A" | ||
|
||
, time = | ||
"%H:%M" | ||
|
||
, longTime = | ||
"%H:%M:%S" | ||
|
||
, dateTime = | ||
"%d %B %Y %-H:%M:%S" | ||
|
||
, firstDayOfWeek = Date.Mon | ||
} | ||
} |
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,161 @@ | ||
module Date.Extra.I18n.I_tr_tr exposing (..) | ||
|
||
{-| English values for day and month names. | ||
@docs dayShort | ||
@docs dayName | ||
@docs monthShort | ||
@docs monthName | ||
@docs dayOfMonthWithSuffix | ||
Copyright (c) 2017 Mehmet Köse | ||
-} | ||
|
||
import Date exposing (Day(..), Month(..)) | ||
|
||
{-| Day short name. | ||
-} | ||
dayShort : Day -> String | ||
dayShort day = | ||
case day of | ||
Mon -> | ||
"Pzt" | ||
|
||
Tue -> | ||
"Sal" | ||
|
||
Wed -> | ||
"Çar" | ||
|
||
Thu -> | ||
"Per" | ||
|
||
Fri -> | ||
"Cum" | ||
|
||
Sat -> | ||
"Cmt" | ||
|
||
Sun -> | ||
"Paz" | ||
|
||
|
||
{-| Day full name. | ||
-} | ||
dayName : Day -> String | ||
dayName day = | ||
case day of | ||
Mon -> | ||
"Pazartesi" | ||
|
||
Tue -> | ||
"Salı" | ||
|
||
Wed -> | ||
"Çarşamba" | ||
|
||
Thu -> | ||
"Perşembe" | ||
|
||
Fri -> | ||
"Cuma" | ||
|
||
Sat -> | ||
"Cumartesi" | ||
|
||
Sun -> | ||
"Pazar" | ||
|
||
|
||
{-| Month short name. | ||
-} | ||
monthShort : Month -> String | ||
monthShort month = | ||
case month of | ||
Jan -> | ||
"Oca" | ||
|
||
Feb -> | ||
"Şub" | ||
|
||
Mar -> | ||
"Mar" | ||
|
||
Apr -> | ||
"Nis" | ||
|
||
May -> | ||
"May" | ||
|
||
Jun -> | ||
"Haz" | ||
|
||
Jul -> | ||
"Tem" | ||
|
||
Aug -> | ||
"Ağu" | ||
|
||
Sep -> | ||
"Eyl" | ||
|
||
Oct -> | ||
"Eki" | ||
|
||
Nov -> | ||
"Kas" | ||
|
||
Dec -> | ||
"Ara" | ||
|
||
|
||
{-| Month full name. | ||
-} | ||
monthName : Month -> String | ||
monthName month = | ||
case month of | ||
Jan -> | ||
"Ocak" | ||
|
||
Feb -> | ||
"Şubat" | ||
|
||
Mar -> | ||
"Mart" | ||
|
||
Apr -> | ||
"Nisan" | ||
|
||
May -> | ||
"Mayıs" | ||
|
||
Jun -> | ||
"Haziran" | ||
|
||
Jul -> | ||
"Temmuz" | ||
|
||
Aug -> | ||
"Ağustos" | ||
|
||
Sep -> | ||
"Eylül" | ||
|
||
Oct -> | ||
"Ekim" | ||
|
||
Nov -> | ||
"Kasım" | ||
|
||
Dec -> | ||
"Aralık" | ||
|
||
|
||
{-| Nothing to do here for Turkish | ||
-} | ||
|
||
dayOfMonthWithSuffix : Bool -> Int -> String | ||
dayOfMonthWithSuffix pad day = | ||
(toString day) ++ "." | ||
|