mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 23:08:48 +00:00
Enhancement: Add formatting options to weather widgets (#3093)
This commit is contained in:
parent
83d1ea5ec4
commit
b5258c5200
6 changed files with 9 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -45,6 +45,7 @@ function Widget({ options }) {
|
|||
value: options.units === "metric" ? data.current.temp_c : data.current.temp_f,
|
||||
style: "unit",
|
||||
unit,
|
||||
...options.format,
|
||||
})}
|
||||
</PrimaryText>
|
||||
<SecondaryText>{data.current.condition.text}</SecondaryText>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue