add cap to dates on slices

This commit is contained in:
Emily
2024-09-23 15:01:14 +02:00
parent 3b6a202538
commit 5b7e93bcbb
8 changed files with 96 additions and 72 deletions

View File

@@ -25,8 +25,10 @@ class DateService {
getChartLabelFromISO(iso: string, locale: string, slice: Slice) {
const date = dayjs(iso).locale(locale);
if (slice === 'hour') return date.format('HH:mm')
if (slice === 'day') return date.format('DD/MM')
if (slice === 'hour') return date.format('HH:mm');
if (slice === 'day') return date.format('DD/MM');
if (slice === 'month') return date.format('MM MMMM');
if (slice === 'year') return date.format('YYYY');
return date.format();
}