fix timezone issues and add support for timezone user setting

This commit is contained in:
Gregor Vostrak
2024-04-23 02:54:28 +02:00
parent 2605d73815
commit f6c51b7122
5 changed files with 48 additions and 17 deletions

View File

@@ -13,7 +13,7 @@ import {
} from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers';
import dayjs from 'dayjs';
import { formatDate, formatTime } from '@/utils/time';
import { formatDate, formatHumanReadableDuration } from '@/utils/time';
const props = defineProps<{
dailyHoursTracked: { duration: number; date: string }[];
@@ -76,11 +76,11 @@ const option = ref({
borderRadius: 5,
},
tooltip: {
valueFormatter: (value: string, dataIndex: number) => {
valueFormatter: (value: number, dataIndex: number) => {
return (
formatDate(props.dailyHoursTracked[dataIndex].date) +
': ' +
formatTime(value)
formatHumanReadableDuration(value)
);
},
},