diff --git a/elm-package.json b/elm-package.json index 3cf41a5..c10e5e4 100644 --- a/elm-package.json +++ b/elm-package.json @@ -17,12 +17,14 @@ "Date.Extra.TimeUnit", "Date.Extra.Utils", "Date.Extra.I18n.I_en_us", + "Date.Extra.I18n.I_fi_fi", "Date.Extra.I18n.I_fr_fr", "Date.Extra.I18n.I_pl_pl", "Date.Extra.Config.Configs", "Date.Extra.Config.Config_en_us", "Date.Extra.Config.Config_en_au", "Date.Extra.Config.Config_en_gb", + "Date.Extra.Config.Config_fi_fi", "Date.Extra.Config.Config_fr_fr", "Date.Extra.Config.Config_pl_pl", "Date.Extra.Field" @@ -31,4 +33,4 @@ "elm-lang/core": "4.0.0 <= v < 5.0.0" }, "elm-version": "0.17.0 <= v < 0.18.0" -} \ No newline at end of file +} diff --git a/src/Date/Extra/Config/Config_fi_fi.elm b/src/Date/Extra/Config/Config_fi_fi.elm new file mode 100644 index 0000000..ec87562 --- /dev/null +++ b/src/Date/Extra/Config/Config_fi_fi.elm @@ -0,0 +1,32 @@ +module Date.Extra.Config.Config_fi_fi exposing (..) + +{-| This is the Finnish config for formatting dates. + +@docs config + +Copyright (c) 2016 Ossi Hanhinen +-} + +import Date +import Date.Extra.Config as Config +import Date.Extra.I18n.I_fi_fi as Finnish + + +{-| Config for fi-fi. -} +config : Config.Config +config = + { i18n = + { dayShort = Finnish.dayShort + , dayName = Finnish.dayName + , monthShort = Finnish.monthShort + , monthName = Finnish.monthName + } + , format = + { date = "%-d.%-m.%Y" -- d.m.YYYY + , longDate = "%A, %-d %B %Y" -- dddd, d MMMM yyyy + , time = "%-H:%M" -- h:mm + , longTime = "%-H:%M:%S" -- h:mm:ss + , dateTime = "%-d.%-m.%Y %-H:%M" -- date + time + , firstDayOfWeek = Date.Mon + } + } diff --git a/src/Date/Extra/I18n/I_fi_fi.elm b/src/Date/Extra/I18n/I_fi_fi.elm new file mode 100644 index 0000000..985c1c6 --- /dev/null +++ b/src/Date/Extra/I18n/I_fi_fi.elm @@ -0,0 +1,76 @@ +module Date.Extra.I18n.I_fi_fi exposing (..) + +{-| Finnish values for day and month names. + +@docs dayShort +@docs dayName +@docs monthShort +@docs monthName + +Copyright (c) 2016 Ossi Hanhinen +-} + + +import Date exposing (Day (..), Month (..)) + + +{-| Day short name. -} +dayShort : Day -> String +dayShort day = + case day of + Mon -> "ma" + Tue -> "ti" + Wed -> "ke" + Thu -> "to" + Fri -> "pe" + Sat -> "la" + Sun -> "su" + + +{-| Day full name. -} +dayName : Day -> String +dayName day = + case day of + Mon -> "maanantai" + Tue -> "tiistai" + Wed -> "keskiviikko" + Thu -> "torstai" + Fri -> "perjantai" + Sat -> "lauantai" + Sun -> "sunnuntai" + + +{-| Month short name. -} +monthShort : Month -> String +monthShort month = + case month of + Jan -> "tammi" + Feb -> "helmi" + Mar -> "maalis" + Apr -> "huhti" + May -> "touko" + Jun -> "kesä" + Jul -> "heinä" + Aug -> "elo" + Sep -> "syys" + Oct -> "loka" + Nov -> "marras" + Dec -> "joulu" + + +{-| Month full name. -} +monthName : Month -> String +monthName month = + case month of + Jan -> "tammikuuta" + Feb -> "helmikuuta" + Mar -> "maaliskuuta" + Apr -> "huhtikuuta" + May -> "toukokuuta" + Jun -> "kesäkuuta" + Jul -> "heinäkuuta" + Aug -> "elokuuta" + Sep -> "syyskuuta" + Oct -> "lokakuuta" + Nov -> "marraskuuta" + Dec -> "joulukuuta"