2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

60_Watches: contrib 0.8.0

git-svn-id: https://svn.fhem.de/fhem/trunk@21833 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-05-01 21:10:03 +00:00
parent a1c7593763
commit 522cb2ab16

View File

@ -1102,6 +1102,7 @@ sub Watches_station {
<script>
var ct_$d;
var time;
// CSRF-Token auslesen
var body = document.querySelector(\"body\");
@ -1346,11 +1347,15 @@ sub Watches_station {
}
// aktueller Timestamp in Millisekunden
command = '{ int(time*1000) }';
url_$d = makeCommand(command);
\$.get( url_$d, function (data) {data = data.replace(/\\n/g, ''); ct_$d = parseInt(data); return ct_$d;} );
var time = new Date(ct_$d);
// var time = new Date(); // alte Variante
command = '{ int(time*1000) }';
url_$d = makeCommand(command);
\$.get( url_$d, function (data) {data = data.replace(/\\n/g, ''); ct_$d = parseInt(data); return ct_$d;} );
if (typeof ct_$d === 'undefined') {
time = new Date(); // mit lokaler Zeit initialisieren -> springen Zeiger verhindern
} else {
time = new Date(ct_$d);
}
// time = new Date(); // alte Variante
var millis = time.getMilliseconds() / 1000.0;
var seconds = time.getSeconds();
var minutes = time.getMinutes();
@ -1633,6 +1638,7 @@ sub Watches_modern {
<script>
var ct_$d;
var now_$d;
// CSRF-Token auslesen
var body = document.querySelector(\"body\");
@ -1709,11 +1715,15 @@ sub Watches_modern {
function drawTime_$d(ctx_$d, radius_$d){
// aktueller Timestamp in Millisekunden
command = '{ int(time*1000) }';
url_$d = makeCommand(command);
command = '{ int(time*1000) }';
url_$d = makeCommand(command);
\$.get( url_$d, function (data) {data = data.replace(/\\n/g, ''); ct_$d = parseInt(data); return ct_$d;} );
var now_$d = new Date(ct_$d);
// var now_$d = new Date(); // alte Variante
if (typeof ct_$d === 'undefined') {
now_$d = new Date(); // mit lokaler Zeit initialisieren -> springen Zeiger verhindern
} else {
now_$d = new Date(ct_$d);
}
// now_$d = new Date(); // alte Variante
var hour_$d = now_$d.getHours();
var minute_$d = now_$d.getMinutes();