timezone improvements

This commit is contained in:
Paul
2019-11-03 11:05:49 +01:00
parent 6275245b03
commit cd7e918690
6 changed files with 19 additions and 17 deletions

View File

@@ -212,7 +212,7 @@
</div>
</div>
<div style="clear:both;">
<br>
<br>
</div>
<div>
<div class="form-group">

View File

@@ -338,22 +338,21 @@
<div id="ntpcontent">
<br>
<legend>Time Settings</legend>
<h6 class="text-muted">With Network Time Protocol (NTP) enabled, all times are adjusted to the local timezone
and
respect daylight saving
time (DST)</h6>
<h6 class="text-muted">With Network Time Protocol (NTP) enabled, all times are adjusted to the local timezone and
respect daylight saving time (DST)</h6>
<br>
<div class="row form-group">
<label class="col-xs-3">Device Time</label>
<span id="utc" class="col-xs-9 col-md-5">
</span>
<span id="utc" class="col-xs-9 col-md-5"></span>
<div class="col-xs-3">
<button onclick="forcentp()" id="forcentp" class="btn btn-info btn-sm">Sync Device with Internet
Time</button>
</div>
</div>
<div class="row form-group">
<label class="col-xs-3">Browser Time</label>
<span id="rtc" class="col-xs-9 col-md-5">
</span>
</div>
<div class="row form-group">
<span id="rtc" class="col-xs-9 col-md-5"></span>
<div class="col-xs-3">
<button onclick="syncBrowserTime()" class="btn btn-info btn-sm">Sync Browser Time to Device</button><i
style="margin-left: 10px;" class="glyphicon glyphicon-info-sign" aria-hidden="true"
@@ -361,6 +360,7 @@
data-content="Use your browser time. Useful when the system does not have an internet connection."></i>
</div>
</div>
<div class="row form-group">
<label class="col-xs-3">NTP<i style="margin-left: 10px;" class="glyphicon glyphicon-info-sign"
aria-hidden="true" data-toggle="popover" data-trigger="hover" data-placement="right"
@@ -372,8 +372,6 @@
<label class="radio-inline">
<input type="radio" value="0" onclick="handleNTPOFF();" name="ntpenabled" checked>Disabled</label>
</form>
<button onclick="forcentp()" id="forcentp" class="btn btn-info btn-sm">Sync Device with Internet
Time</button>
</div>
</div>
<div class="row form-group">

View File

@@ -715,8 +715,6 @@ function initMQTTLogTable() {
if (value < 1563300000) {
return "(" + value + ")";
} else {
var comp = new Date();
value = Math.floor(value + ((comp.getTimezoneOffset() * 60) * -1));
var vuepoch = new Date(value * 1000);
var formatted = vuepoch.getUTCFullYear() +
"-" + twoDigits(vuepoch.getUTCMonth() + 1) +