www/js/prod_inprod.js

changeset 339
da1f4525169d
parent 330
eebe99e9fd99
child 467
f8d16480a6a7
equal deleted inserted replaced
338:a51b858aacca 339:da1f4525169d
78 // We use the getTime() method and get the unixtime 78 // We use the getTime() method and get the unixtime
79 date1_unixtime = parseInt(date1.getTime() / 1000); 79 date1_unixtime = parseInt(date1.getTime() / 1000);
80 date2_unixtime = parseInt(date2.getTime() / 1000); 80 date2_unixtime = parseInt(date2.getTime() / 1000);
81 // This is the calculated difference in seconds 81 // This is the calculated difference in seconds
82 var timeDifference = date1_unixtime - date2_unixtime; 82 var timeDifference = date1_unixtime - date2_unixtime;
83 var timeDifferenceInDays = timeDifference / 60 / 60 / 24; 83 // Round the result for brews that overlap summer/wintertime changes.
84 var timeDifferenceInDays = Math.round(timeDifference / 60 / 60 / 24);
84 if (timeDifferenceInDays >= 14) 85 if (timeDifferenceInDays >= 14)
85 fase = StageData[value].nl + " dag " + (timeDifferenceInDays - 14) + " van 28"; 86 fase = StageData[value].nl + " dag " + (timeDifferenceInDays - 14) + " van 28";
86 else 87 else
87 fase = StageData[value].nl + " dag " + timeDifferenceInDays + " van 14"; 88 fase = StageData[value].nl + " dag " + timeDifferenceInDays + " van 14";
88 } 89 }

mercurial