Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tweaking Date type

  • Loading branch information...
commit 49c912caa94785e5655062a5085bee95234450f4 1 parent f0ab027
@pnomolos authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Spot/Type/Date.php
View
2  lib/Spot/Type/Date.php
@@ -9,7 +9,7 @@ class Datetime implements TypeInterface
*/
public static function cast($value)
{
- if(is_string($value) || is_numeric($value)) {
+ if($value && (is_string($value) || is_numeric($value))) {
// Create new \DateTime instance from string value
$value = new \DateTime('@' . strtotime($value));
}
Please sign in to comment.
Something went wrong with that request. Please try again.