Merge pull request #460 from dhensby/pulls/2.4/date-override

FIX If BlogPost has date field, return it in getDate
This commit is contained in:
Michael Strong 2017-07-27 11:10:25 +12:00 committed by GitHub
commit 58a4693129
1 changed files with 3 additions and 0 deletions

View File

@ -693,6 +693,9 @@ class BlogPost extends Page
*/
public function getDate()
{
if ($this->hasDatabaseField('Date')) {
return $this->getField('Date');
}
return !empty($this->PublishDate) ? $this->PublishDate : null;
}