From 1c433fc56b26963eb2b75ad45c3612855992d79f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 12 Mar 2026 12:52:51 -0600 Subject: [PATCH] Display both feels like and outdoor temperatures --- antonclk/antonclk.app.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/antonclk/antonclk.app.js b/antonclk/antonclk.app.js index 722f7c5..0914e06 100644 --- a/antonclk/antonclk.app.js +++ b/antonclk/antonclk.app.js @@ -18,7 +18,8 @@ let stopWatchTimer = null; let myMessage = ""; - let temperature = ""; + let temperature = "?"; + let feels_like = "?"; let drawTimer = null; @@ -90,19 +91,22 @@ var utcHour = Math.floor(utc / 3600); var utcMinute = Math.floor((utc % 3600) / 60); var utcStr = utcHour.toString().padStart(2, '0') + ":" + utcMinute.toString().padStart(2, '0'); - g.setFontAlign(0, 0).setFont("Vector", 36).drawString(utcStr, x-25, y+43); + g.setFontAlign(0, 0).setFont("Vector", 36).drawString(utcStr, x-32, y+43); - var tz_offset = date.toString().indexOf("GMT"); - var tz = date.toString().substring(tz_offset+3, tz_offset+6); - g.setFontAlign(0, 0).setFont("Vector", 24).drawString(tz, x+60, y+43); + //var tz_offset = date.toString().indexOf("GMT"); + //var tz = date.toString().substring(tz_offset+3, tz_offset+6); + //g.setFontAlign(0, 0).setFont("Vector", 24).drawString(tz, x+60, y+43); + + g.setFontAlign(0, 0).setFont("Vector", 26).drawString(temperature, x+53, y+43); // Show date and day of week const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - var dateStr = date.getDate() + " " + days[date.getDay()] + " " + temperature; + var dateStr = date.getDate() + " " + days[date.getDay()]; // don't draw date string if stopwatch 2 is running if (!stopWatch.start2 && !stopWatch.elapsed2) { - g.setFontAlign(0, 0).setFont("Vector", 26).drawString(dateStr, x, y+76); + g.setFontAlign(0, 0).setFont("Vector", 26).drawString(dateStr, x-32, y+74); + g.setFontAlign(0, 0).setFont("Vector", 26).drawString(feels_like, x+53, y+74); } //var wrapped = g.wrapString(myMessage, g.getWidth()-10).join("\n"); @@ -122,6 +126,7 @@ let result = JSON.parse(event.resp); myMessage = result.context; temperature = result.temperature; + feels_like = result.feels_like; if (watchState == STATE_IDLE) { if (paintFace) paintFace(); }