Fix for task archived_at in API

This commit is contained in:
Hillel Coren 2017-06-12 21:18:20 +03:00
parent 255f8baaa9
commit 1cb9c15925

View File

@ -37,7 +37,13 @@ class EntityTransformer extends TransformerAbstract
protected function getTimestamp($date) protected function getTimestamp($date)
{ {
return method_exists($date, 'getTimestamp') ? $date->getTimestamp() : null; if (method_exists($date, 'getTimestamp')) {
return $date->getTimestamp();
} elseif (is_string($date)) {
return strtotime($date);
} else {
return null;
}
} }
public function getDefaultIncludes() public function getDefaultIncludes()