Commit 3b293b87 by colm

fixes endering issue in mini timeline for events that have no end-date meaning…

fixes endering issue in mini timeline for events that have no end-date meaning single day events, or non period events
parent dede395a
......@@ -26,7 +26,6 @@ $(function() {
var firstDate = moment($(".schedule__item").first().find("time").attr("datetime"));
var lastDate = moment($(".schedule__item").last().find("time").attr("datetime"));
var firstDate = new Date(firstDate);
var lastDate = new Date(lastDate);
......@@ -54,10 +53,13 @@ $(function() {
// Computes the size and position of the timeline entries
$(".schedule__item").each(function() {
var currentStartDate = moment($(this).find(".start-date").attr("datetime"));
var currentEndDate = moment($(this).find(".end-date").attr("datetime"));
if ( $(this).find(".end-date").length ){
var currentEndDate = moment($(this).find(".end-date").attr("datetime"));
}
var intDate = $(this).find(".int-date");
if (intDate.length > 0){
var intDate = moment($(this).find(".int-date").attr("datetime"));
console.log(intDate);
var anchor = $(this).attr("id");
var pc = (1 - (lastDate - currentStartDate) / (lastDate - firstDate)) * 100;
var pc2 = (1 - (lastDate - currentEndDate) / (lastDate - firstDate)) * 100;
......
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