Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #54 from Ciki/patch-1
Browse files Browse the repository at this point in the history
set midnight so the limit dates pass the :RANGE validation rule
  • Loading branch information
hrach authored Oct 10, 2017
2 parents aacb1cd + 6286f44 commit 6cc2aea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Controls/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ protected function getDefaultParser()
return $value;
};
}


/**
* @return \Nette\Utils\DateTime|NULL
*/
public function getValue()
{
$val = parent::getValue();
// set midnight so the limit dates (min & max) pass the :RANGE validation rule
if ($val instanceof Nette\Utils\DateTime) {
$val->setTime(0, 0, 0);
}
return $val;
}
}

0 comments on commit 6cc2aea

Please sign in to comment.