Skip to content

Commit

Permalink
Merge branch '3.x' into 220-opening-webcam-stat-tile-modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Nov 21, 2023
2 parents 95bc54d + 04336c8 commit 2ef6ac6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,3 +752,4 @@ See https://github.com/Daveiano/weewx-wdc/compare/v3.3.0...580071ca175a03fe4924b
- Bugfixed Added missing `nl.conf` in `install.py` GH-221
- Bugfix: Fixed Gauge tiles daily reset (via MQTT)
- Open Webcam Links/Stat Tile links in a Modal GH-220
- Bugfix: Max Rain Rate Does Not Reset GH-224
7 changes: 7 additions & 0 deletions skins/weewx-wdc/src/js/live-updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ const onMessageArrived = (message: Message) => {
`Last update was ${dayjs.unix(payLoad.dateTime).format("HH:mm:ss")}`
);

const lastGenerated_ts = (window as any).weewxWdcConfig.time,
lastGenerated_formatted = dayjs
.unix(parseInt(lastGenerated_ts))
.format("YYYY-MM-DD");

for (const key in payLoad) {
if (["dateTime", "usUnits", "interval"].includes(key)) continue;

Expand All @@ -497,6 +502,8 @@ const onMessageArrived = (message: Message) => {
// Day changed, reset min/max/sum.
if (
lastUpdate_ts &&
lastGenerated_formatted !==
dayjs.unix(payLoad.dateTime).format("YYYY-MM-DD") &&
lastUpdate_formatted !== dayjs.unix(payLoad.dateTime).format("YYYY-MM-DD")
) {
dayChange = true;
Expand Down

0 comments on commit 2ef6ac6

Please sign in to comment.