Fix error Call to a member function setDate() on boolean

This commit is contained in:
Hadi Nategh 2017-11-27 18:05:47 +01:00
parent 6f29f16b7c
commit a7fcb77d1b

View File

@ -115,7 +115,7 @@ class Date extends Transformer
{
$date = new Api\DateTime($value);
}
if($this->type == 'date-timeonly')
if($this->type == 'date-timeonly' && $date)
{
$date->setDate(1970, 1, 1);
}