protected function AmpPrepareMetadataJson::prepareDatePublished in Accelerated Mobile Pages (AMP) 8
Prepare the published date.
1 call to AmpPrepareMetadataJson::prepareDatePublished()
- AmpPrepareMetadataJson::prepareMetadataJson in src/
Utility/ AmpPrepareMetadataJson.php - Prepares a metadata array to be ready for JSON conversion.
File
- src/
Utility/ AmpPrepareMetadataJson.php, line 194
Class
- AmpPrepareMetadataJson
- Class AmpPrepareMetadataJson
Namespace
Drupal\amp\UtilityCode
protected function prepareDatePublished() {
$date_published = date(DATE_ATOM, $this->node
->getCreatedTime());
if (!empty($date_published)) {
$this->ampPreparedMetadataJson['datePublished'] = $date_published;
}
}