json-encode times as epoch seconds, as elm prefers
This commit is contained in:
parent
ea2732e525
commit
8dda4c37ba
2
elm.json
2
elm.json
@ -10,6 +10,7 @@
|
|||||||
"elm/core": "1.0.5",
|
"elm/core": "1.0.5",
|
||||||
"elm/html": "1.0.0",
|
"elm/html": "1.0.0",
|
||||||
"elm/http": "2.0.0",
|
"elm/http": "2.0.0",
|
||||||
|
"elm/json": "1.1.3",
|
||||||
"elm/svg": "1.0.1",
|
"elm/svg": "1.0.1",
|
||||||
"elm/time": "1.0.0",
|
"elm/time": "1.0.0",
|
||||||
"elm-explorations/test": "2.2.0",
|
"elm-explorations/test": "2.2.0",
|
||||||
@ -20,7 +21,6 @@
|
|||||||
"indirect": {
|
"indirect": {
|
||||||
"elm/bytes": "1.0.8",
|
"elm/bytes": "1.0.8",
|
||||||
"elm/file": "1.0.5",
|
"elm/file": "1.0.5",
|
||||||
"elm/json": "1.1.3",
|
|
||||||
"elm/parser": "1.1.0",
|
"elm/parser": "1.1.0",
|
||||||
"elm/random": "1.0.0",
|
"elm/random": "1.0.0",
|
||||||
"elm/url": "1.0.0",
|
"elm/url": "1.0.0",
|
||||||
|
@ -6,6 +6,7 @@ import Html.Attributes as H exposing (src, style, width, height)
|
|||||||
import Html.Events exposing (onClick)
|
import Html.Events exposing (onClick)
|
||||||
import Html.Events.Extra.Pointer as Pointer
|
import Html.Events.Extra.Pointer as Pointer
|
||||||
import Maybe exposing (Maybe)
|
import Maybe exposing (Maybe)
|
||||||
|
import Json.Decode as D
|
||||||
import Http
|
import Http
|
||||||
import Svg exposing (Svg, svg, rect, circle, g)
|
import Svg exposing (Svg, svg, rect, circle, g)
|
||||||
import Svg.Attributes as S exposing
|
import Svg.Attributes as S exposing
|
||||||
|
@ -24,6 +24,7 @@ import Debug.Trace (trace, traceShow)
|
|||||||
import Text.Read (readMaybe)
|
import Text.Read (readMaybe)
|
||||||
import Text.XML
|
import Text.XML
|
||||||
import Text.XML.Cursor as Cursor
|
import Text.XML.Cursor as Cursor
|
||||||
|
import Data.Time.Clock.POSIX (posixSecondsToUTCTime, utcTimeToPOSIXSeconds)
|
||||||
|
|
||||||
data Pos = Pos Double Double (Maybe Double) deriving (Show, Eq)
|
data Pos = Pos Double Double (Maybe Double) deriving (Show, Eq)
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ instance ToJSON Point where
|
|||||||
toJSON Point {..} =
|
toJSON Point {..} =
|
||||||
object
|
object
|
||||||
[ "pos" .= pos,
|
[ "pos" .= pos,
|
||||||
"time" .= time,
|
"time" .= utcTimeToPOSIXSeconds time,
|
||||||
"cadence" .= cadence,
|
"cadence" .= cadence,
|
||||||
"power" .= power,
|
"power" .= power,
|
||||||
"heartRate" .= heartRate
|
"heartRate" .= heartRate
|
||||||
|
Loading…
Reference in New Issue
Block a user