From a105192882cc07f69548f4ff8d00f79cf443e913 Mon Sep 17 00:00:00 2001 From: jelveh Date: Sun, 29 Dec 2024 21:53:43 -0800 Subject: [PATCH] Update dev-center.js --- src/dev-center/js/dev-center.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/dev-center/js/dev-center.js b/src/dev-center/js/dev-center.js index b06e1cdb9..df4b3dc33 100644 --- a/src/dev-center/js/dev-center.js +++ b/src/dev-center/js/dev-center.js @@ -2870,8 +2870,15 @@ async function render_analytics(period){ // Format the data const labels = app.stats.grouped_stats.open_count.map(item => { - const date = new Date(item.period); - // Different format based on grouping + let date; + if (stats_grouping === 'month') { + // Handle YYYY-MM format explicitly + const [year, month] = item.period.split('-'); + date = new Date(parseInt(year), parseInt(month) - 1); // month is 0-based in JS + } else { + date = new Date(item.period); + } + if (stats_grouping === 'hour') { return date.toLocaleString('en-US', { hour: 'numeric', hour12: true }).toLowerCase(); } else if (stats_grouping === 'day') {