Was having an issue with Jelly_Field_Timestamp's setter. If you give it the timestamp 1302372000 it tries to put 978267757 into the database. This is because there's a weird behaviour with PHP's strtotime where it interprets 1302372000 as a valid date and passes back a timestamp, not FALSE as you'd expect.
I've fixed this by swapping the order of the IF in Jelly_Field_Timestamp's setter;
public function set($value)
{
if ($value === NULL OR ($this->null AND empty($value)))
{
return NULL;
}
// This is the other way around in master.
if (is_numeric($value))
{
return (int) $value;
}
elseif (FALSE !== strtotime($value))
{
return strtotime($value);
}
return $value;
}
Which seems to work a treat.
Seemed too minor a change to bother forking, but sorry if that would have been easier.
Hi there,
Was having an issue with Jelly_Field_Timestamp's setter. If you give it the timestamp 1302372000 it tries to put 978267757 into the database. This is because there's a weird behaviour with PHP's strtotime where it interprets 1302372000 as a valid date and passes back a timestamp, not FALSE as you'd expect.
I've fixed this by swapping the order of the IF in Jelly_Field_Timestamp's setter;
Which seems to work a treat.
Seemed too minor a change to bother forking, but sorry if that would have been easier.
Hope that's helpful to someone!