Commit 88088d03 authored by amarcic's avatar amarcic
Browse files

timeline, timelineAdaptor: handling for period end date 'present'

parent bebc61ca
......@@ -49,11 +49,17 @@ const timelineAdapter = ( object ) => {
let periodData = {};
let timelineData = [];
const date = new Date();
const currentYear = date.getFullYear();
object.temporal?.flat().forEach( period => {
let periodStuff = {
periodName: period.title,
periodType: period.type,
periodSpan: period.begin||period.end ? [period.begin, period.end] : undefined
periodSpan: period.begin||period.end
? [period.begin, period.end!=="present"? period.end : currentYear]
: undefined
};
//only checks for senses when period has no begin
//assumes there are no periods with an end but no beginning
......
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