diff --git a/src/html/js/entries.js b/src/html/js/entries.js index 71e18d8..78610a9 100644 --- a/src/html/js/entries.js +++ b/src/html/js/entries.js @@ -183,8 +183,6 @@ var ListViewModel = function() { self.savedItem=ko.toJS(item); self.selectedItem(item); - console.debug(self.savedItem); - $("#value_date").datepicker().on('changeDate', function(ev){ self.selectedItem().value_date(ev.date.format(ev.currentTarget.dataset.dateFormat)); }); @@ -284,12 +282,20 @@ drawChart = function(entries, element) { today.setHours(0); today.setMinutes(0); + var day = 24 * 60 * 60 * 1000; + + var firstDate = new Date(Date.parse(entries[0][0]).valueOf() - day).format('yyyy-mm-dd'); + var lastDate = new Date(Date.parse(entries[entries.length -1][0]).valueOf() + day).format('yyyy-mm-dd'); + // plot chart window.chart = $.jqplot(element.id, chartValues, { title: "Évolution du solde", axes:{ xaxis:{ + autoscale: true, renderer:$.jqplot.DateAxisRenderer, + min: firstDate, + max: lastDate, tickOptions: {formatString: "%F"} }, yaxis: {