Bug fix
All checks were successful
Deploy to production / build (push) Successful in 11s

This commit is contained in:
Sean Edmunds
2026-07-14 16:50:33 -05:00
parent 78d887de9a
commit b8eedde727
3 changed files with 37 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined }
return {
dewpoint: hourly.dew_point_2m?.[index].toFixed(0),
isDaytime: hourly.is_day?.[index],
name: hourly.time[index],
name: hourly.time[index].toLocaleString('en-us'),
startTime: hourly.time[index],
endTime: hourly.time[index + 1],
probabilityOfPrecipitation: hourly.precipitation_probability?.[index],
@@ -39,7 +39,6 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined }
};
})
.filter((hour: any) => hour.startTime > now && hour.startTime < later);
return (
<Stack
style={{
@@ -65,8 +64,8 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined }
data={[
{ value: 12, label: '12 hours' },
{ value: 24, label: '24 hours' },
{ value: 28, label: '2 days' },
{ value: 48, label: '3 days' },
{ value: 48, label: '2 days' },
{ value: 72, label: '3 days' },
{ value: 168, label: '7 days' },
]}
onChange={(value: any) => setTimeFrame(value)}
@@ -78,10 +77,7 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined }
type='category'
stroke={'var(--mantine-color-primary-0)'}
dataKey={(data) => {
return new Date(data.startTime).toLocaleTimeString('en-US', {
hour: 'numeric',
minute: 'numeric',
});
return new Date(data.startTime).toLocaleString('en-US');
}}
/>
<YAxis
@@ -154,10 +150,7 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined }
type='category'
stroke={'var(--mantine-color-primary-0)'}
dataKey={(data) => {
return new Date(data.startTime).toLocaleTimeString('en-US', {
hour: 'numeric',
minute: 'numeric',
});
return new Date(data.startTime).toLocaleTimeString('en-US');
}}
/>
<YAxis stroke={'var(--mantine-color-primary-0)'} unit={'%'} domain={[0, 100]} />