BUGFIX: for date manipulation use the SS_Datetime::now, otherwise it does not respect the mock date.

This commit is contained in:
Mateusz Uzdowski 2011-05-23 18:12:31 +12:00 committed by Ingo Schommer
parent 7f4541e9f0
commit 7026a488e6

View File

@ -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'));
}
/**