Commit efde3021 authored by Audrey Hamelers's avatar Audrey Hamelers
parent fc2f79e1
Pipeline #12991 passed with stages
in 5 minutes and 45 seconds
......@@ -175,7 +175,7 @@ async function createMetadataXML(tmpPath, manuscript) {
)
} else {
dateStr += moment(pDate.date).format(
'[<year>]YYYY[</year>\n<month>]MM[</month>\n<day>]DD[</day>]',
'[<day>]DD[</day>\n<month>]MM[</month>\n<year>]YYYY[</year>]',
)
}
dateStr += '</pub-date>'
......@@ -184,20 +184,15 @@ async function createMetadataXML(tmpPath, manuscript) {
.join('\n')
: ''
}`
// decide on the nihms-submitted date
// audrey [9:32 AM]
// I'm not sure if it's the date the submission moves to the 'submitted' state or the date we send it to PMC
// We will get it from the audit_log table if it's the first one
// mike (20190121): It's the day the manuscript files were packaged for the tagger, i.e. when it moved to the state "tagging_ready".
// we will get this from the audit table as a set of JSON objects.
// audrey (20190121): it can be sent out for retagging multiple times, and it should be the first date
// #874 As discussed the NIHMS submitted date should now be the date the first manuscript file was first uploaded.
try {
const submittedDate = manuscript.audits
.filter(audit => audit.changes.status === 'tagging_ready')
.sort((action1, action2) => action1.created - action2.created)[0].created
const submittedDate = manuscript.audits.find(
audit =>
audit.objectType === 'file' && audit.changes.type === 'manuscript',
).created
xml += `<pub-date pub-type="nihms-submitted">
${moment(submittedDate).format(
'[<year>]YYYY[</year>\n<month>]MM[</month>\n<day>]DD[</day>]',
'[<day>]DD[</day>\n<month>]MM[</month>\n<year>]YYYY[</year>]',
)}
</pub-date>\n`
} catch (ignored) {
......
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