all repos

onasty @ bc92b8268dc567b48d4d567ffdfefb0442152335

a one-time notes service

onasty/web/src/Data/Me.elm (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
web: pretty time (#157)..., 11 months ago
1
module Data.Me exposing (Me, decode)
2
3
import Iso8601
4
import Json.Decode as Decode exposing (Decoder)
5
import Time exposing (Posix)
6
7
8
type alias Me =
9
    { email : String
10
    , createdAt : Posix
11
    }
12
13
14
decode : Decoder Me
15
decode =
16
    Decode.map2 Me
17
        (Decode.field "email" Decode.string)
18
        (Decode.field "created_at" Iso8601.decoder)