Skip to content

Commit

Permalink
Adding a small buffer (5 seconds) to startCannotBeInThePast to keep l…
Browse files Browse the repository at this point in the history
…atency from causing an exception.
  • Loading branch information
joshforbes committed Oct 25, 2016
1 parent 6556b04 commit 15b2b59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Temporal.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function isValid(Carbon $validTime = null)
*/
protected function startCannotBeInThePast()
{
if ($this->valid_start < new Carbon()) {
if ($this->valid_start < Carbon::now()->subSeconds(5)) {
throw new InvalidDateRangeException;
}
}
Expand Down

0 comments on commit 15b2b59

Please sign in to comment.