Skip to content
Snippets Groups Projects
Commit 336bb8e4 authored by Gregor Gawol's avatar Gregor Gawol Committed by Dorian Merz
Browse files

refs #18674 [master] citation, also display years with square brackets

* improve apa template
parent 6d56dbe1
No related merge requests found
......@@ -502,7 +502,9 @@ class Citation extends \VuFind\View\Helper\Root\Citation
protected function getYear()
{
if (isset($this->details['pubDate'])) {
if (strlen($this->details['pubDate']) > 4) {
if ((strlen($this->details['pubDate']) > 4)
&& !preg_match("/^\[\d+\]/", $this->details['pubDate'])
) {
try {
return $this->dateConverter->convertFromDisplayDate(
'Y',
......
<?php if (!empty($this->authors)): ?><?=$this->escapeHtml($this->authors)?>
<?php if (!empty($this->year)): ?><?php if (!empty($this->authors)): ?><?php endif; ?>(<?=$this->escapeHtml($this->year)?>). <?php endif; ?>
<?php if (!empty($this->year)): ?>
<?php if (!preg_match("/^\[\d+\]/", $this->year)): ?>
(<?=$this->escapeHtml($this->year)?>).
<?php else: ?>
<?=$this->escapeHtml($this->year)?>.
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<i><?=$this->escapeHtml($this->title)?></i><?php if ($this->periodAfterTitle): ?>. <?php endif ?>
<?php if (empty($this->authors)): ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment