Skip to content

Commit

Permalink
Update Article.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Swader authored Nov 23, 2017
1 parent 933f4e7 commit 3cdce8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Entity/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ public function getDate()
if (!isset($this->data['date'])) {
return null;
}
try {
return (class_exists('\Carbon\Carbon')) ?
new \Carbon\Carbon($this->data['date'], 'GMT') :
$this->data['date'];
} catch (\Exception $e) {
return null;
}
}

/**
Expand Down

0 comments on commit 3cdce8c

Please sign in to comment.