Round days for brews that overlap summer/wintertime changes.

Mon, 01 Apr 2019 19:57:34 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 01 Apr 2019 19:57:34 +0200
changeset 339
da1f4525169d
parent 338
a51b858aacca
child 340
fa4eb830c151

Round days for brews that overlap summer/wintertime changes.

www/js/prod_inprod.js file | annotate | diff | comparison | revisions
--- a/www/js/prod_inprod.js	Mon Apr 01 19:52:34 2019 +0200
+++ b/www/js/prod_inprod.js	Mon Apr 01 19:57:34 2019 +0200
@@ -80,7 +80,8 @@
 					date2_unixtime = parseInt(date2.getTime() / 1000);
 					// This is the calculated difference in seconds
 					var timeDifference = date1_unixtime - date2_unixtime;
-					var timeDifferenceInDays = timeDifference / 60 / 60 / 24;
+					// Round the result for brews that overlap summer/wintertime changes.
+					var timeDifferenceInDays = Math.round(timeDifference / 60 / 60 / 24);
 					if (timeDifferenceInDays >= 14)
 						fase = StageData[value].nl + " dag " + (timeDifferenceInDays - 14) + " van 28";
 					else

mercurial