Commit 0805f7c3 authored by Audrey Hamelers's avatar Audrey Hamelers

use epub year in activity citation when no ppub year

parent 43fc9c52
Pipeline #13060 passed with stages
in 5 minutes and 45 seconds
......@@ -165,14 +165,16 @@ class MetaSec extends React.Component {
return log
}, {})
const year =
(publicationDates &&
publicationDates.find(d => d.type === 'ppub') &&
(publicationDates.find(d => d.type === 'ppub').jatsDate
? publicationDates.find(d => d.type === 'ppub').jatsDate.year
: moment(
publicationDates.find(d => d.type === 'ppub').date,
).year())) ||
null
publicationDates &&
publicationDates.reduce((retYear, date) => {
const getYear = date.jatsDate
? date.jatsDate.year
: moment(date.date).year()
if (date.type === 'ppub' || !retYear) {
return getYear
}
return retYear
}, null)
const { edit, notif } = this.state
return (
<React.Fragment>
......
Markdown is supported
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