Skip to content

Commit

Permalink
Merge pull request #13 from rl-king/dutch
Browse files Browse the repository at this point in the history
Add Dutch language
  • Loading branch information
ryan-haskell authored Oct 27, 2018
2 parents 95dd0ed + 0323722 commit 29a4881
Showing 1 changed file with 97 additions and 6 deletions.
103 changes: 97 additions & 6 deletions src/DateFormat/Language.elm
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module DateFormat.Language
exposing
( Language
, english
, spanish
)
module DateFormat.Language exposing
( Language
, english, spanish
, dutch
)

{-|
Expand Down Expand Up @@ -116,6 +115,7 @@ toEnglishAmPm : Int -> String
toEnglishAmPm hour =
if hour > 11 then
"pm"

else
"am"

Expand Down Expand Up @@ -240,3 +240,94 @@ toSpanishWeekdayName weekday =

Sun ->
"Domingo"



-- Dutch


{-| The dutch language!
-}
dutch : Language
dutch =
Language
toDutchMonthName
(toDutchMonthName >> String.left 3)
toDutchWeekdayName
(toDutchWeekdayName >> String.left 3)
toEnglishAmPm
toDutchSuffix


toDutchMonthName : Time.Month -> String
toDutchMonthName month =
case month of
Jan ->
"januari"

Feb ->
"februari"

Mar ->
"maart"

Apr ->
"april"

May ->
"mei"

Jun ->
"juni"

Jul ->
"juli"

Aug ->
"augustus"

Sep ->
"september"

Oct ->
"oktober"

Nov ->
"november"

Dec ->
"december"


toDutchWeekdayName : Time.Weekday -> String
toDutchWeekdayName weekday =
case weekday of
Mon ->
"maandag"

Tue ->
"dinsdag"

Wed ->
"woensdag"

Thu ->
"donderdag"

Fri ->
"vrijdag"

Sat ->
"zaterdag"

Sun ->
"zondag"


toDutchSuffix : Int -> String
toDutchSuffix num =
if num > 20 || num == 1 || num == 8 then
"ste"

else
"de"

0 comments on commit 29a4881

Please sign in to comment.