Converted a significant amount of files from js to ts.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { Weather } from "lib/types/weather.js";
|
||||
import { Variable } from "types/variable.js";
|
||||
import icons from "../../../../../icons/index.js";
|
||||
|
||||
export const HourlyIcon = (theWeather, getNextEpoch) => {
|
||||
export const HourlyIcon = (theWeather: Variable<Weather>, getNextEpoch: any) => {
|
||||
return Widget.Icon({
|
||||
class_name: "hourly-weather-icon",
|
||||
icon: theWeather.bind("value").as((w) => {
|
||||
@@ -16,9 +18,11 @@ export const HourlyIcon = (theWeather, getNextEpoch) => {
|
||||
let iconQuery = weatherAtEpoch?.condition.text
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replaceAll(" ", "_");
|
||||
.replaceAll(" ", "_")
|
||||
|| "warning"
|
||||
;
|
||||
|
||||
if (!weatherAtEpoch?.isDay && iconQuery === "partly_cloudy") {
|
||||
if (!weatherAtEpoch?.is_day && iconQuery === "partly_cloudy") {
|
||||
iconQuery = "partly_cloudy_night";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user