Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add formatting options to weather widgets #3093

Merged
merged 3 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add format option to weather widgets
  • Loading branch information
benphelps committed Mar 9, 2024
commit 019a70ef24d629e77a27882ea4e8d0a6bbbd240d
1 change: 1 addition & 0 deletions src/components/widgets/openmeteo/openmeteo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function Widget({ options }) {
value: data.current_weather.temperature,
style: "unit",
unit,
...options.format,
})}
</PrimaryText>
<SecondaryText>{t(`wmo.${data.current_weather.weathercode}-${timeOfDay}`)}</SecondaryText>
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/openweathermap/weather.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Widget({ options }) {
<Container options={options} additionalClassNames="information-widget-openweathermap">
<PrimaryText>
{options.label && `${options.label}, `}
{t("common.number", { value: data.main.temp, style: "unit", unit })}
{t("common.number", { value: data.main.temp, style: "unit", unit, ...options.format })}
</PrimaryText>
<SecondaryText>{data.weather[0].description}</SecondaryText>
<WidgetIcon icon={mapIcon(condition, timeOfDay)} size="xl" />
Expand Down