From 7026a488e617f7a1b7e31ee598a5c340d12397b3 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Mon, 23 May 2011 18:12:31 +1200 Subject: [PATCH] BUGFIX: for date manipulation use the SS_Datetime::now, otherwise it does not respect the mock date. --- model/fieldtypes/Date.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/fieldtypes/Date.php b/model/fieldtypes/Date.php index f789dd82c..effeda1b6 100644 --- a/model/fieldtypes/Date.php +++ b/model/fieldtypes/Date.php @@ -302,7 +302,7 @@ class Date extends DBField { * @return boolean */ public function InPast() { - return strtotime($this->value) < time(); + return strtotime($this->value) < SS_Datetime::now()->Format('U'); } /** @@ -310,7 +310,7 @@ class Date extends DBField { * @return boolean */ public function InFuture() { - return strtotime($this->value) > time(); + return strtotime($this->value) > SS_Datetime::now()->Format('U'); } /** @@ -318,7 +318,7 @@ class Date extends DBField { * @return boolean */ public function IsToday() { - return (date('Y-m-d', strtotime($this->value)) == date('Y-m-d', time())); + return (date('Y-m-d', strtotime($this->value)) == SS_Datetime::now()->Format('Y-m-d')); } /**