ui: fix weekday mapper for x axis on >7d range

This commit is contained in:
nick-delirium 2024-12-24 15:13:30 +01:00
parent 6078872f0e
commit 1397cace53
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -16,7 +16,7 @@ export const getTimeString = (ts, period, density,) => {
return weekdays[ date.getDay() ];
} else {
const isPM = date.getHours() >= 12;
return `${ isPM ? date.getHours() - 12 : date.getHours() }:${ startWithZero(date.getMinutes()) } ${isPM? 'pm' : 'am'}`;
return `${weekdays[ date.getDay() ]} ${ isPM ? date.getHours() - 12 : date.getHours() }:${ startWithZero(date.getMinutes()) } ${isPM? 'pm' : 'am'}`;
}
}
return `${ date.getDate() }/${ startWithZero(date.getMonth() + 1) } `;