Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: for date manipulation use the SS_Datetime::now, otherwise it …

…does not respect the mock date.
  • Loading branch information...
commit 7026a488e617f7a1b7e31ee598a5c340d12397b3 1 parent 7f4541e
@mateusz mateusz authored chillu committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 model/fieldtypes/Date.php
View
6 model/fieldtypes/Date.php
@@ -302,7 +302,7 @@ public function requireField() {
* @return boolean
*/
public function InPast() {
- return strtotime($this->value) < time();
+ return strtotime($this->value) < SS_Datetime::now()->Format('U');
}
/**
@@ -310,7 +310,7 @@ public function InPast() {
* @return boolean
*/
public function InFuture() {
- return strtotime($this->value) > time();
+ return strtotime($this->value) > SS_Datetime::now()->Format('U');
}
/**
@@ -318,7 +318,7 @@ public function InFuture() {
* @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'));
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.