diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-17 09:34:02 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-17 09:34:02 +0000 |
commit | d2a2ece999eb879d051116b64f11998152f910df (patch) | |
tree | 259b30ace273df31dfd483d9da8276b370c52ac0 | |
parent | 19b5829b093f766a53882c71e6c78c8ed9557156 (diff) | |
download | sariulclocks-d2a2ece999eb879d051116b64f11998152f910df.tar.gz |
fix cookies expiring immediately after 6pm KST
-rw-r--r-- | src/Types/Session.hs | 5 |
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! |