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

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