diff --git a/components/charts/area-chart.tsx b/components/charts/area-chart.tsx index 64ee618..0bd5cfb 100644 --- a/components/charts/area-chart.tsx +++ b/components/charts/area-chart.tsx @@ -41,23 +41,24 @@ export function AreaChartComponent({ {title} {description && {description}} - + - + value.slice(0, 5)} + hide /> { const areaChartData: AreaChartData[] = data.map((r) => { return { - property: r.method_name, + property: `${r.class_name} / ${r.method_name}`, value: toDuration(r.duration_ms), }; }); diff --git a/lib/formatting.ts b/lib/formatting.ts index 842bc7c..103690b 100644 --- a/lib/formatting.ts +++ b/lib/formatting.ts @@ -52,32 +52,35 @@ export const formatDateTime = ( const systemZone = Intl.DateTimeFormat().resolvedOptions().timeZone; const timezoneSplit = dateTimeString.split(' '); - let timezone = systemZone; let adjustedDateTimeString = dateTimeString; if (timezoneSplit.length > 1) { - timezone = timezoneSplit.pop() || systemZone; + timezoneSplit.pop(); adjustedDateTimeString = timezoneSplit.join(' '); } - let dateTime = DateTime.fromISO(adjustedDateTimeString, { zone: timezone }); + let dateTime = DateTime.fromISO(adjustedDateTimeString, { + zone: systemZone, + }); if (!dateTime.isValid) { dateTime = DateTime.fromRFC2822(adjustedDateTimeString, { - zone: timezone, + zone: systemZone, }); } if (!dateTime.isValid) { - dateTime = DateTime.fromHTTP(adjustedDateTimeString, { zone: timezone }); + dateTime = DateTime.fromHTTP(adjustedDateTimeString, { + zone: systemZone, + }); } if (!dateTime.isValid) { throw new Error('Invalid date-time format'); } - const formattedDate = dateTime.toUTC().toFormat('yyyy-MM-dd'); - const formattedTime = dateTime.toUTC().toFormat('hh:mm:ss a'); + const formattedDate = dateTime.toFormat('yyyy-MM-dd'); + const formattedTime = dateTime.toFormat('hh:mm:ss a'); return { date: formattedDate, time: formattedTime }; } catch (error) {