diff --git a/app/views/charts/multiple_series.html.erb b/app/views/charts/multiple_series.html.erb index a216b79..850ac87 100644 --- a/app/views/charts/multiple_series.html.erb +++ b/app/views/charts/multiple_series.html.erb @@ -119,10 +119,8 @@ // converts date format from JSON function getChartDate(d) { - // get the data using javascript's date object (year, month, day, hour, minute, second) - // months in javascript start at 0, so remember to subtract 1 when specifying the month // offset in minutes is converted to milliseconds and subtracted so that chart's x-axis is correct - return Date.UTC(d.substring(0,4), d.substring(5,7)-1, d.substring(8,10), d.substring(11,13), d.substring(14,16), d.substring(17,19)) - (my_offset * 60000); + return Date.parse(d) - (my_offset * 60000); } diff --git a/app/views/charts/show.html.erb b/app/views/charts/show.html.erb index ea609ca..e552466 100644 --- a/app/views/charts/show.html.erb +++ b/app/views/charts/show.html.erb @@ -14,10 +14,8 @@ // converts date format from JSON function getChartDate(d) { - // get the data using javascript's date object (year, month, day, hour, minute, second) - // months in javascript start at 0, so remember to subtract 1 when specifying the month // offset in minutes is converted to milliseconds and subtracted so that chart's x-axis is correct - return Date.UTC(d.substring(0,4), d.substring(5,7)-1, d.substring(8,10), d.substring(11,13), d.substring(14,16), d.substring(17,19)) - (myOffset * 60000); + return Date.parse(d) - (myOffset * 60000); } $(document).on('page:load ready', function() { diff --git a/app/views/pages/export.html.erb b/app/views/pages/export.html.erb index 83cedba..8104296 100644 --- a/app/views/pages/export.html.erb +++ b/app/views/pages/export.html.erb @@ -9,10 +9,8 @@ // converts date format from JSON function getChartDate(d) { - // get the data using javascript's date object (year, month, day, hour, minute, second) - // months in javascript start at 0, so remember to subtract 1 when specifying the month // offset in minutes is converted to milliseconds and subtracted so that chart's x-axis is correct - return Date.UTC(d.substring(0,4), d.substring(5,7)-1, d.substring(8,10), d.substring(11,13), d.substring(14,16), d.substring(17,19)) - (myOffset * 60000); + return Date.parse(d) - (myOffset * 60000); } $(document).on('page:load ready', function() { diff --git a/app/views/plugins/templates/chart.js b/app/views/plugins/templates/chart.js index 0985e1b..1681df7 100644 --- a/app/views/plugins/templates/chart.js +++ b/app/views/plugins/templates/chart.js @@ -112,10 +112,8 @@ // converts date format from JSON function getChartDate(d) { - // get the data using javascript's date object (year, month, day, hour, minute, second) - // months in javascript start at 0, so remember to subtract 1 when specifying the month // offset in minutes is converted to milliseconds and subtracted so that chart's x-axis is correct - return Date.UTC(d.substring(0,4), d.substring(5,7)-1, d.substring(8,10), d.substring(11,13), d.substring(14,16), d.substring(17,19)) - (my_offset * 60000); + return Date.parse(d) - (my_offset * 60000); }