Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
Set time to 0 explicitly
Browse files Browse the repository at this point in the history
Creating tasks would fail 1 in 10 times. The reasons for this is that
now would sometimes be one-second ahead. Therefore the task endpoint
would return a 400 for bad request. As the validator just needs to
check that now is either todays date or in the future I have removed
the time from the Date Time
  • Loading branch information
jeremyquinton committed Feb 9, 2015
1 parent 6223a92 commit c7c17c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Opg/Core/Model/Entity/Task/Task.php
Expand Up @@ -352,6 +352,7 @@ public function getInputFilter()
'callback' => function ($value, $context = array()) {
$dueDate = $value;
$now = new \DateTime();
$now->setTime(0, 0, 0);

return $now <= $dueDate;
}
Expand Down

0 comments on commit c7c17c6

Please sign in to comment.