Skip to content

Commit 329ae3a

Browse files
committed
index.html: add timestamp to Home Battery data
1 parent f5d07ff commit 329ae3a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

SmartEVSE-3/data/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,12 @@
261261
$('[id=with_p1_api_data_time]').hide();
262262
}
263263

264-
if(data.home_battery.last_update == 0) {
265-
$('[id=with_homebattery]').hide();
266-
} else {
264+
if(data.home_battery.last_update > 0) {
265+
$('#battery_last_update_time').text(new Date(data.home_battery.last_update * 1000).toLocaleTimeString());
266+
$('#battery_last_update_date').text(new Date(data.home_battery.last_update * 1000).toLocaleDateString());
267267
$('[id=with_homebattery]').show();
268+
} else {
269+
$('[id=with_homebattery]').hide();
268270
}
269271

270272
if(data.home_battery.current == 0) {

0 commit comments

Comments
 (0)