protected function CslReferenceNormalizer::extractDate in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/src/Normalizer/CslReferenceNormalizer.php \Drupal\bibcite_entity\Normalizer\CslReferenceNormalizer::extractDate()
Extract date value to CSL format.
Parameters
\Drupal\Core\Field\FieldItemListInterface $date_field: Date item list.
Return value
array Date in CSL format.
1 call to CslReferenceNormalizer::extractDate()
- CslReferenceNormalizer::extractFields in modules/
bibcite_entity/ src/ Normalizer/ CslReferenceNormalizer.php - Extract fields values from reference entity.
File
- modules/
bibcite_entity/ src/ Normalizer/ CslReferenceNormalizer.php, line 147
Class
- CslReferenceNormalizer
- Normalizes/denormalizes reference entity to CSL format.
Namespace
Drupal\bibcite_entity\NormalizerCode
protected function extractDate(FieldItemListInterface $date_field) {
$value = $this
->extractScalar($date_field);
return [
'date-parts' => [
[
$value,
],
],
'literal' => $value,
];
}