mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
support freedom units
This commit is contained in:
parent
6ad7afe8f8
commit
785b0c306c
1 changed files with 4 additions and 1 deletions
|
@ -24,7 +24,10 @@ function temperature(value, units){
|
|||
}
|
||||
|
||||
function renderWeatherCard(context, data, units){
|
||||
let description = `### ${weatherIcon(data.result.current.icon.id)} ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ${pill("Wind")} ${smallPill(data.result.current.wind.speed + " km/h")}`
|
||||
let description = `### ${weatherIcon(data.result.current.icon.id)} ${temperature(data.result.current.temperature.current, units)} • ${data.result.current.condition.label}\n\n${pill("Feels like")} ${smallPill(temperature(data.result.current.temperature.feels_like, units))} ${pill("Wind")} `
|
||||
|
||||
if(units == "°F") description += smallPill((data.result.current.wind.speed / 1.609).toFixed(2) + " mph")
|
||||
else description += smallPill((data.result.current.wind.speed).toFixed(2) + " km/h")
|
||||
|
||||
let secondaryPills = [];
|
||||
if(data.result.current.humidity > 0) secondaryPills.push(`${pill("Humidity")} ${smallPill(Math.floor(data.result.current.humidity * 100) + "%")}`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue