A music player that connects to your cloud/distributed storage. diffuse.sh
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105module Time.Ext exposing (decoder, default, encode, monthName, monthNumber)
import Json.Decode as Decode exposing (Decoder)import Json.Encode as Jsonimport Time exposing (Month(..))
-- 🔱
decoder : Decoder Time.Posixdecoder = Decode.map Time.millisToPosix Decode.int
default : Time.Posixdefault = Time.millisToPosix 0
encode : Time.Posix -> Json.Valueencode time = Json.int (Time.posixToMillis time)
monthName : Time.Month -> StringmonthName month = case month of Jan -> "January"
Feb -> "February"
Mar -> "March"
Apr -> "April"
May -> "May"
Jun -> "June"
Jul -> "July"
Aug -> "August"
Sep -> "September"
Oct -> "October"
Nov -> "November"
Dec -> "December"
monthNumber : Time.Month -> IntmonthNumber month = case month of Jan -> 1
Feb -> 2
Mar -> 3
Apr -> 4
May -> 5
Jun -> 6
Jul -> 7
Aug -> 8
Sep -> 9
Oct -> 10
Nov -> 11
Dec -> 12