This commit is contained in:
@@ -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]} />
|
||||
|
||||
Reference in New Issue
Block a user