Commit 87d31804 authored by gijs's avatar gijs

Focus on 2nd loop

parent 812f02cf
......@@ -111,15 +111,21 @@
var timelineEntries = document.querySelectorAll('main > section'),
now = new Date();
// for (var i=0; i < timelineEntries.length; i++) {
// if (timelineEntries[i].dataset.type == 'interbellum') {
// if (now < (new Date(timelineEntries[i].dataset.date))) {
// return timelineEntries[i];
// }
// } else {
// if(now < (new Date(timelineEntries[i].dataset.end))) {
// return timelineEntries[i];
// }
// }
// }
for (var i=0; i < timelineEntries.length; i++) {
if (timelineEntries[i].dataset.type == 'interbellum') {
if (now < (new Date(timelineEntries[i].dataset.date))) {
return timelineEntries[i];
}
} else {
if(now < (new Date(timelineEntries[i].dataset.end))) {
return timelineEntries[i];
}
if (timelineEntries[i].dataset.type == 'loop' && timelineEntries[i].dataset.loop == '2') {
return timelineEntries[i];
}
}
......
......@@ -111,15 +111,21 @@
var timelineEntries = document.querySelectorAll('main > section'),
now = new Date();
// for (var i=0; i < timelineEntries.length; i++) {
// if (timelineEntries[i].dataset.type == 'interbellum') {
// if (now < (new Date(timelineEntries[i].dataset.date))) {
// return timelineEntries[i];
// }
// } else {
// if(now < (new Date(timelineEntries[i].dataset.end))) {
// return timelineEntries[i];
// }
// }
// }
for (var i=0; i < timelineEntries.length; i++) {
if (timelineEntries[i].dataset.type == 'interbellum') {
if (now < (new Date(timelineEntries[i].dataset.date))) {
return timelineEntries[i];
}
} else {
if(now < (new Date(timelineEntries[i].dataset.end))) {
return timelineEntries[i];
}
if (timelineEntries[i].dataset.type == 'loop' && timelineEntries[i].dataset.loop == '2') {
return timelineEntries[i];
}
}
......
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