pyc-website
main website for pyc inc.
git clone https://9o.is/git/pyc-website.git
commit 3fbb6d4b2f32421bf6e96677af4023cca1b587d2 parent a601ee7bb64308662d201bd7879c813de42a9a47 Author: Jul <jul@9o.is> Date: Mon, 21 Jul 2014 19:17:23 -0400 off by 1 error - timeForToday in model.Atm.scala Diffstat:
| M | src/main/scala/inc/pyc/model/Atm.scala | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main/scala/inc/pyc/model/Atm.scala b/src/main/scala/inc/pyc/model/Atm.scala @@ -63,7 +63,12 @@ class Atm private () extends MongoRecord[Atm] with ObjectIdPk[Atm] { private def timeForToday: TimeOpen = { val now = DateTime.now - val today = now.dayOfWeek.get + + val today = { + val n = now.dayOfWeek.get + if(n==7) 0 else n // DateTime's Sunday is 7, but TimeOpen's Sunday is 0 + } + times.get(today) }