From 7e8fd0a41064e465d5d9c3c92ea6a43695e32e5c Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 13 Jan 2013 09:50:15 +0100 Subject: [PATCH] Fixed today vertical line by setting time to 0:00. --- src/html/js/entries.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/html/js/entries.js b/src/html/js/entries.js index e190009..6901f8c 100644 --- a/src/html/js/entries.js +++ b/src/html/js/entries.js @@ -1,3 +1,4 @@ +// Entry object function entry(data){ this.id=ko.observable(ko.utils.unwrapObservable(data.id)); this.value_date=ko.observable(ko.utils.unwrapObservable(data.value_date)); @@ -383,6 +384,10 @@ drawChart = function(entries, element) { chartValues[0] = entries; + var today = new Date(); + today.setHours(0); + today.setMinutes(0); + // plot chart window.chart = $.jqplot(element.id, chartValues, { title: "Évolution du solde", @@ -419,7 +424,7 @@ drawChart = function(entries, element) { }}, { dashedVerticalLine: { name: "today", - x: new Date(), + x: today, lineWidth: 1, color: "gray", shadow: false