hide first time bucket

This commit is contained in:
lelo 2025-04-02 09:54:35 +00:00
parent dd4c417200
commit 0e3cfb280a

View File

@ -214,8 +214,12 @@
// shift the labels to local time zone // shift the labels to local time zone
const timeframe = "{{ timeframe }}"; // e.g., 'last24hours', '7days', '30days', or '365days' const timeframe = "{{ timeframe }}"; // e.g., 'last24hours', '7days', '30days', or '365days'
const shiftedLabels = timeframeData.map(item => { const shiftedLabels = timeframeData.map((item, index) => {
if (timeframe === 'last24hours') { if (timeframe === 'last24hours') {
// Hide the first bucket
if (index === 0) return '';
// item.bucket is now in the format "YYYY-MM-DDTHH:00:00Z" // item.bucket is now in the format "YYYY-MM-DDTHH:00:00Z"
const bucketDate = new Date(item.bucket); const bucketDate = new Date(item.bucket);
const now = new Date(); const now = new Date();