aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-17 09:34:02 +0000
committerSean Whitton <spwhitton@spwhitton.name>2015-03-17 09:34:02 +0000
commitd2a2ece999eb879d051116b64f11998152f910df (patch)
tree259b30ace273df31dfd483d9da8276b370c52ac0
parent19b5829b093f766a53882c71e6c78c8ed9557156 (diff)
downloadsariulclocks-d2a2ece999eb879d051116b64f11998152f910df.tar.gz
fix cookies expiring immediately after 6pm KST
-rw-r--r--src/Types/Session.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Types/Session.hs b/src/Types/Session.hs
index 7941070..b7ff979 100644
--- a/src/Types/Session.hs
+++ b/src/Types/Session.hs
@@ -47,7 +47,10 @@ endOfSchoolDay now = (toUTCTime . addToClockTime noTimeDiff { tdHour = hoursTi
koreanTime = ((toUTCTime . addToClockTime noTimeDiff { tdHour = 9 }) now)
{ ctTZ = 9 * 60 * 60
, ctTZName = "KST"}
- hoursTilEndOfDay = 18 - ctHour koreanTime
+ hoursTilEndOfDay = if hoursTilEndOfDay' > 0
+ then hoursTilEndOfDay'
+ else 1
+ hoursTilEndOfDay' = 18 - ctHour koreanTime
-- could use Maybe monad in the below!