miniBill / date-format-languages / DateFormat.Languages

Fun fact: Some people don't know english.

That's why it's important to include alternative date formatting options for other languages!

This module exposes Language (compatible with ryannhg/date-format) and DateLanguage (compatible with justinmimbs/date), along with a few implementations.

(If you want to see german or swahili, please add them in! I'm happy to make your language a part of the package!)

Language


type alias Language =
{ toMonthName : Time.Month -> String
, toMonthAbbreviation : Time.Month -> String
, toWeekdayName : Time.Weekday -> String
, toWeekdayAbbreviation : Time.Weekday -> String
, toAmPm : Basics.Int -> String
, toOrdinalSuffix : Basics.Int -> String 
}

A record with options for your language. Compatible with ryannhg/date-format.

Languages

english : Language

The english language! (used by default)

spanish : Language

The spanish language!

dutch : Language

The dutch language!

swedish : Language

The Swedish language!

portuguese : Language

The Portuguese language!

french : Language

The French language!

finnish : Language

The Finnish language!

norwegian : Language

The Norwegian language!

greek : Language

The greek language!

italian : Language

The italian language!

slovenian : Language

The slovenian language!

Compatibility


type alias DateLanguage =
{ monthName : Time.Month -> String
, monthNameShort : Time.Month -> String
, weekdayName : Time.Weekday -> String
, weekdayNameShort : Time.Weekday -> String
, dayWithSuffix : Basics.Int -> String 
}

A record with options for your language. Compatible with justinmimbs/date.

toDateLanguage : Language -> DateLanguage

This converts a Language do a DateLanguage