From 9cda556429b5d0ad5b60308fefbb922239139a19 Mon Sep 17 00:00:00 2001 From: Pat Date: Mon, 4 Feb 2019 15:43:47 -0500 Subject: [PATCH] MQTT Last Updated now uses stations locale for time format Updates #56 Updates #46 --- skins/Belchertown/index.html.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skins/Belchertown/index.html.tmpl b/skins/Belchertown/index.html.tmpl index b3b98386..8fcf0658 100644 --- a/skins/Belchertown/index.html.tmpl +++ b/skins/Belchertown/index.html.tmpl @@ -444,7 +444,7 @@ jQuery(".offlineMarker").show(); jQuery(".loadingMarker").hide(); epoch = parseFloat( (d / 1000) ).toFixed(0); // Convert millis to seconds - updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("MMMM D, YYYY, h:mm:ss a"); // requires moment.js + updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("LL, LTS"); // requires moment.js jQuery(".updated").html( "Failed connecting to the weather station on "+ updated +". Please try again later!" ); console.log( updated + ": Cannot connect to MQTT broker" ); } @@ -456,7 +456,7 @@ jQuery(".offlineMarker").show(); jQuery(".loadingMarker").hide(); epoch = parseFloat( (d / 1000) ).toFixed(0); // Convert millis to seconds - updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("MMMM D, YYYY, h:mm:ss a"); // requires moment.js + updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("LL, LTS"); // requires moment.js jQuery(".updated").html( "Lost connection to the weather station on "+ updated +". Please try again later!" ); if (responseObject.errorCode !== 0) { console.log( updated + ": mqtt Connection Lost: "+responseObject.errorMessage ); @@ -489,7 +489,7 @@ // Updated time epoch = parseFloat( data["dateTime"] ).toFixed(0); - updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("MMMM D, YYYY, h:mm:ss a"); + updated = moment.unix(epoch).utcOffset($moment_js_utc_offset).format("LL, LTS"); //seconds_ago = moment(updated, "MMMM Do YYYY, h:mm:ss a").fromNow(); // "a few seconds ago || in a few seconds" updated_text = "Connected to weather station live. Data received " + updated; jQuery(".updated").html( updated_text );