Commit ae9d42cc authored by Cédric F.'s avatar Cédric F.

Fix bad offset when drawing weeks

parent 4e47e8b5
......@@ -233,8 +233,11 @@ isCurrentWeek model time =
let
now =
model.now
halfWeek =
oneWeek / 2
in
now <= time && time < now + oneWeek
now - halfWeek <= time && time < now + halfWeek
isPast : Model -> Time -> Bool
......@@ -293,7 +296,7 @@ yearWeekToTime model ( year, week ) =
6
yearOffset =
toFloat (week - 1) * oneWeek + toFloat (firstMondayOffset + 1) * oneDay
toFloat (week - 1) * oneWeek + toFloat firstMondayOffset * oneDay
in
Date.toTime beginningOfYear + yearOffset
......
......@@ -69,13 +69,13 @@ links model =
demo =
"ewogICJiaXJ0aC1kYXRlIjogIjE5ODgtMDctMjQiLAogICJsaWZlLWV4cGVjdGFuY3kiOiA4MCwKICAia2lkLXVudGlsIjogMTgsCiAgIm9sZC1mcm9tIjogNzAsCiAgImV2ZW50cyI6IFsKICAgIHsKICAgICAgImZyb20iOiAiMjAxMC0wOS0xNCIsCiAgICAgICJ0byI6ICIyMDE0LTAyLTAxIiwKICAgICAgImNvbG9yIjogIiNmNTc5MDAiLAogICAgICAibGFiZWwiOiAiY29sbGVnZSIKICAgIH0sCiAgICB7CiAgICAgICJmcm9tIjogIjIwMTUtMDYtMDEiLAogICAgICAidG8iOiAiMjAxNi0wNS0zMSIsCiAgICAgICJjb2xvciI6ICIjNzNkMjE2IiwKICAgICAgImxhYmVsIjogInRyaXAiCiAgICB9CiAgXQp9Cg=="
base64 =
current =
Serializer.serialize model
in
[ nav [ class "nav nav-inline text-xs-center mb-1" ]
[ a [ class "nav-link", href "#" ] [ text "blank chart" ]
, a [ class "nav-link", href <| "#" ++ demo ] [ text "demo chart" ]
, a [ class "nav-link", href <| "#" ++ base64 ] [ text "bookmark your own chart" ]
, a [ class "nav-link", href <| "#" ++ current ] [ text "bookmark your own chart" ]
]
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment