mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 23:09:26 +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:
parent
a1c7593763
commit
522cb2ab16
@ -1102,6 +1102,7 @@ sub Watches_station {
|
||||
<script>
|
||||
|
||||
var ct_$d;
|
||||
var time;
|
||||
|
||||
// CSRF-Token auslesen
|
||||
var body = document.querySelector(\"body\");
|
||||
@ -1349,8 +1350,12 @@ sub Watches_station {
|
||||
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
|
||||
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\");
|
||||
@ -1712,8 +1718,12 @@ sub Watches_modern {
|
||||
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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user