aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model/Date.elm
blob: f3c9b91fb1b176d24b8e1285eb2b3c86e5734c54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Model.Date exposing
  ( timeDecoder
  , dateDecoder
  )

import Date as Date exposing (Date)
import Time exposing (Time)

import Json.Decode as Json exposing (..)

timeDecoder : Decoder Time
timeDecoder = Json.map Date.toTime dateDecoder

dateDecoder : Decoder Date
dateDecoder = customDecoder string Date.fromString