Skip to content

Commit

Permalink
Merge pull request #18 from ohanhi/master
Browse files Browse the repository at this point in the history
Add Finnish locale
  • Loading branch information
rluiten authored Jul 8, 2016
2 parents 07d76c0 + 69a1cd0 commit d0e0a2f
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
4 changes: 3 additions & 1 deletion elm-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -31,4 +33,4 @@
"elm-lang/core": "4.0.0 <= v < 5.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}
}
32 changes: 32 additions & 0 deletions src/Date/Extra/Config/Config_fi_fi.elm
Original file line number Diff line number Diff line change
@@ -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
}
}
76 changes: 76 additions & 0 deletions src/Date/Extra/I18n/I_fi_fi.elm
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit d0e0a2f

Please sign in to comment.