miniBill/date-format-languages/1.1.0

NOTE: the latest version is 1.3.0

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/miniBill/date-format-languages.

What we checked: Tag 1.1.0 is still on github.com/miniBill/date-format-languages; its commit 4e9e56ab435f is from 2019-09-19 09:04 UTC, before the version was published (2019-09-19 09:06 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/miniBill/date-format-languages/zipball/1.1.0/

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 : Month -> String
, toMonthAbbreviation : Month -> String
, toWeekdayName : Weekday -> String
, toWeekdayAbbreviation : Weekday -> String
, toAmPm : Int -> String
, toOrdinalSuffix : 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!

Compatibility

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

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

toDateLanguage : Language -> DateLanguage

This converts a Language do a DateLanguage