NEWS
Gibt es einen Zeit/Datums-Adapter oder Script?
-
Hallo,
das Widget ist das Bar-Widget (hoizontal).
Hier das Skript (läuft bei mir in der Javascript Instanz 0.
/* System Datuminfo Skript erzeugt Variablen für Datum, Tag, Monat, Jahr, KW, Quartal KW1 = 1\. Donnerstag im Jahr 1\. Wochentag ist Montag Feiertage aus Adapter iobroker.feiertage 25.02.2016 erstellt von pix 28.04.2016 Prüft ob KW gerade oder ungerade Wochentag als Zahl (deutsches System: Mo = 1, So = 7) 28.05.2016 parseFloat bei toFixed-Werten zugefügt (nach Variablen Typ Warnung) Variablen Typ einiger Objekte geändert 30.09.2018 Optimierung im Code todo Adapter: Grundunterscheidung im Objektbaum: Deutsch (de)/Englisch (en) Jahreszeiten Beispieldatum Donnerstag, 28\. Apil 2016 */ const path = "javascript." + instance + ".Kalender.Datuminfo.de"; // Pfad zu Objekten im javascript-Adapter const fC = false; // Objekte neu erstellen? const logging = false; const dezimals = 1; // Dezimalstellen Anteilausgabe const monthNameLong = ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]; const monthNameShort = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]; const dayWeekNameLong = ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"]; // So 1 und 7 const dayWeekNameShort = ["So","Mo","Di","Mi","Don","Fr","Sa","So"]; // ++++++++++ Objekte // Adapter feiertage installiert? const feiertag = true; // Schalter Feiertag-Adapter nutzen oder nicht const idHolidayToday = "feiertage.0.heute.boolean"/*Feiertag heute?*/; const idHolidayTodayName = "feiertage.0.heute.Name"/*Feiertag heute - Name*/; // AB HIER NIX MEHR EINSTELLEN // Jahr /* Jahr datuminfo.0.de.jahr.nummer (2016) datuminfo.0.de.jahr.schaltjahr (true) */ const idYear = path + ".Jahr.Zahl"; const idYearLeap = path + ".Jahr.Schaltjahr"; createState(idYear, 0, fC, { name: "Kalender - Jahreszahl", type: "number", role: "value" }); createState(idYearLeap, false, fC, { name: "Kalender - Schaltjahr", type: "boolean", role: "indicator" }); // Quartal const idQuart = path + ".Quartal.Nummer"; const idQuartEven = path + ".Quartal.gerade"; const idQuartPastCount = path + ".Quartal.Vergangenheit.Anzahl"; const idQuartPastShare = path + ".Quartal.Vergangenheit.Anteil"; const idQuartFutureCount = path + ".Quartal.Zukunft.Anzahl"; const idQuartFutureShare = path + ".Quartal.Zukunft.Anteil"; createState(idQuart, 1, fC, { name: "Kalender - Quartal - Nummer", type: "number", min: 1, max: 4, role: "level" }); createState(idQuartEven, { name: "Kalender - Quartal - gerade", type: "boolean", role: "indicator" }); createState(idQuartPastCount, 0, fC, { name: "Kalender - Quartal - Anzahl vergangene Quartale im Jahr", type: "number", min: 0, max: 3, role: "level" }); createState(idQuartPastShare, 0, fC, { name: "Kalender - Quartal - Anteil vergangene Quartale im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idQuartFutureCount, 0, fC, { name: "Kalender - Quartal - Anzahl kommender Quartale im Jahr", type: "number", min: 0, max: 3, role: "level" }); createState(idQuartFutureShare, 0, fC, { name: "Kalender - Quartal - Anteil kommender Quartale im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); /* Monat datuminfo.0.de.monat.name.lang (April) datuminfo.0.de.monat.name.kurz (April) datuminfo.0.de.monat.nummer.deutsch.nummer (4) datuminfo.0.de.monat.nummer.deutsch.gerade (true) datuminfo.0.de.monat.nummer.deutsch.ungerade (false) datuminfo.0.de.monat.nummer.system.nummer (5) datuminfo.0.de.monat.nummer.system.gerade (false) datuminfo.0.de.monat.nummer.system.ungerade (true) datuminfo.0.de.monat.jahr.nummer (4) // deutsch datuminfo.0.de.monat.jahr.anzahl (12) datuminfo.0.de.monat.jahr.vergangenheit.anzahl (4) datuminfo.0.de.monat.jahr.vergangenheit.Anteil (4 von 12) (4*100)/12 datuminfo.0.de.monat.jahr.zukunft.anzahl (8) datuminfo.0.de.monat.jahr.zukunft.Anteil (8 von 12) (8*100)/12 */ const idMonthNameShort = path + ".Monat.Name.kurz"; const idMonthNameLong = path + ".Monat.Name.lang"; const idMonthNumberCount = path + ".Monat.Nummer.Nummer"; const idMonthNumberEven = path + ".Monat.Nummer.gerade"; const idMonthYearCount = path + ".Monat.Jahr.Anzahl"; // steht fest const idMonthYearPastCount = path + ".Monat.Jahr.Vergangenheit.Anzahl"; const idMonthYearPastShare = path + ".Monat.Jahr.Vergangenheit.Anteil"; const idMonthYearFutureCount = path + ".Monat.Jahr.Zukunft.Anzahl"; const idMonthYearFutureShare = path + ".Monat.Jahr.Zukunft.Anteil"; createState(idMonthNameShort, "", fC, { name: "Kalender - Monat - kurze Name", type: "string", role: "text" }); createState(idMonthNameLong, "", fC, { name: "Kalender - Monat - langer Name", type: "string", role: "text" }); createState(idMonthNumberCount, 1, fC, { name: "Kalender - Monat - Nummer", desc: "Januar = 1, ..., Monat Dezember = 12", type: "number", min: 1, max: 12, role: "level" }); createState(idMonthNumberEven, false, fC, { name: "Kalender - Monat - Nummer - gerade", type: "boolean", role: "indicator" }); createState(idMonthYearCount, 12, fC, { name: "Kalender - Monate - Anzahl im Jahr", type: "number", role: "val", min: 12, max: 12 }); createState(idMonthYearPastCount, 0, fC, { name: "Kalender - Monate - Anzahl vergangene Monate im Jahr", type: "number", role: "level", min: 0, max: 11 }); createState(idMonthYearPastShare, Math.round(1/12), fC, { name: "Kalender - Monate - Anteil vergangene Monate im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idMonthYearFutureCount, 0, fC, { name: "Kalender - Monate - Anzahl kommender Monate im Jahr", type: "number", role: "level", min: 0, max: 11 }); createState(idMonthYearFutureShare, Math.round(11/12), fC, { name: "Kalender - Monate - Anteil kommender Monate im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); /* Woche datuminfo.0.de.woche.gesamt (52) datuminfo.0.de.woche.vergangenheit.anzahl (17) datuminfo.0.de.woche.vergangenheit.Anteil (17 von 52) 17*100/52 datuminfo.0.de.woche.zukunft.anzahl (35) datuminfo.0.de.woche.zukunft.Anteil (35 von 52) 35*100/52 datuminfo.0.de.woche.nummer (17) datuminfo.0.de.woche.gerade (true) datuminfo.0.de.woche.ungerade (false) */ const idWeekYearCount = path + ".Woche.Jahr.Anzahl"; // steht fest const idWeekYearNumberCount = path + ".Woche.Jahr.Kalenderwoche.Nummer"; const idWeekYearNumberEven = path + ".Woche.Jahr.Kalenderwoche.gerade"; const idWeekYearPastCount = path + ".Woche.Jahr.Vergangenheit.Anzahl"; const idWeekYearPastShare = path + ".Woche.Jahr.Vergangenheit.Anteil"; const idWeekYearFutureCount = path + ".Woche.Jahr.Zukunft.Anzahl"; const idWeekYearFutureShare = path + ".Woche.Jahr.Zukunft.Anteil"; createState(idWeekYearCount, 52, fC, { name: "Kalender - Wochen im Jahr - Anzahl", type: "number", role: "level" }); createState(idWeekYearPastCount, 0, fC, { name: "Kalender - Wochen - Anzahl vergangene Wochen im Jahr", type: "number", min: 0, max: 52, role: "level" }); createState(idWeekYearPastShare, 0, fC, { name: "Kalender - Wochen - Anteil vergangene Wochen im Jahr", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idWeekYearFutureCount, 0, fC, { name: "Kalender - Wochen - Anzahl kommender Wochen im Jahr", type: "number", min: 0, max: 52, role: "level" }); createState(idWeekYearFutureShare, 0, fC, { name: "Kalender - Wochen - Anteil kommender Wochen im Jahr", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idWeekYearNumberCount, 0, fC, { name: "Kalender - Wochen - Kalenderwoche", type: "number", min: 0, max: 53, unit: "KW", role: "level" }); createState(idWeekYearNumberEven, false, fC, { name: "Kalender - Wochen - Kalenderwoche gerade", type: "boolean", role: "indicator" }); /* Tag datuminfo.0.de.tag.woche.name.lang (Donnerstag) datuminfo.0.de.tag.woche.name.kurz (Do) datuminfo.0.de.tag.woche.nummer.deutsch (4) datuminfo.0.de.tag.woche.nummer.system (4) datuminfo.0.de.tag.woche.vergangenheit.anzahl (4) // deutsches system ab Montag datuminfo.0.de.tag.woche.vergangenheit.Anteil (4 von 7) 4*100/7 datuminfo.0.de.tag.woche.zukunft.anzahl (3) datuminfo.0.de.tag.woche.zukunft.Anteil (3 von 7) 3*100/7 datuminfo.0.de.tag.monat.gesamt (30) // tage im monat datuminfo.0.de.tag.monat.vergangenheit.anzahl (28) // seit monats beginn datuminfo.0.de.tag.monat.vergangenheit.Anteil (28 von 30) 28*100/30 datuminfo.0.de.tag.monat.zukunft.anzahl (2) // bis monatsende datuminfo.0.de.tag.monat.zukunft.Anteil (2 von 30) 2*100/30 datuminfo.0.de.tag.monat.nummer (28) datuminfo.0.de.tag.monat.gerade (true) datuminfo.0.de.tag.monat.ungerade (false) datuminfo.0.de.tag.jahr.nummer (119) datuminfo.0.de.tag.jahr.gerade (true) datuminfo.0.de.tag.jahr.ungerade (false) datuminfo.0.de.tag.jahr.gesamt (366) datuminfo.0.de.tag.jahr.vergangenheit.anzahl (119) // seit jahresbeginn datuminfo.0.de.tag.jahr.vergangenheit.Anteil (119 von 366) 119*100/366 datuminfo.0.de.tag.jahr.zukunft.anzahl (247) // bis jahresende datuminfo.0.de.tag.jahr.zukunft.Anteil (247 von 366) 247*100/366 */ const idDayName = path + ".Tag.Name"; const idDayHoliday = path + ".Tag.Feiertag"; createState(idDayName, "", fC, { name: "Kalender - Name des Tages", type: "string", role: "text" }); createState(idDayHoliday, false, fC, { name: "Kalender - heute Feiertag?", type: "boolean", role: "indicator" }); const idDayWeekNameLong = path + ".Tag.Woche.Name.lang"; const idDayWeekNameShort = path + ".Tag.Woche.Name.kurz"; const idDayWeekNumber = path + ".Tag.Woche.Nummer"; const idDayWeekPastCount = path + ".Tag.Woche.Vergangenheit.Anzahl"; const idDayWeekPastShare = path + ".Tag.Woche.Vergangenheit.Anteil"; const idDayWeekFutureCount = path + ".Tag.Woche.Zukunft.Anzahl"; const idDayWeekFutureShare = path + ".Tag.Woche.Zukunft.Anteil"; createState(idDayWeekNameLong, "", fC, { name: "Kalender - Tag der Woche - langer Name", type: "string", role: "dayofweek" }); createState(idDayWeekNameShort, "", fC, { name: "Kalender - Tag der Woche - kurzer Name", type: "string", role: "dayofweek" }); createState(idDayWeekNumber, 1, fC, { name: "Kalender - Tag der Woche - Nummer", desc: "Mo = 1, ..., Sa = 6, So = 7", type: "number", role: "level", min: 1, max: 7 }); createState(idDayWeekPastCount, 0, fC, { name: "Kalender - Tag der Woche - Anzahl vergangene Tage in der Woche", type: "number", min: 0, max: 6, role: "value" }); createState(idDayWeekPastShare, 0, fC, { name: "Kalender - Tag der Woche - Anteil vergangene Tage in der Woche", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idDayWeekFutureCount, 0, fC, { name: "Kalender - Tag der Woche - Anzahl kommender Tage in der Woche", type: "number", min: 0, max: 6, role: "value" }); createState(idDayWeekFutureShare, 0, fC, { name: "Kalender - Tag der Woche - Anteil kommender Tage in der Woche", type: "number", unit: "%", min: 0, max: 100, role: "level" }); const idDayMonthCount = path + ".Tag.Monat.Anzahl"; const idDayMonthPastCount = path + ".Tag.Monat.Vergangenheit.Anzahl"; const idDayMonthPastShare = path + ".Tag.Monat.Vergangenheit.Anteil"; const idDayMonthFutureCount = path + ".Tag.Monat.Zukunft.Anzahl"; const idDayMonthFutureShare = path + ".Tag.Monat.Zukunft.Anteil"; const idDayMonthNumber = path + ".Tag.Monat.Nummer"; const idDayMonthEven = path + ".Tag.Monat.gerade"; createState(idDayMonthCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl Tage im Monat", type: "number", min: 28, max: 31, role: "level" }); createState(idDayMonthPastCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl vergangene Tage im Monat", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthPastShare, 0, fC, { name: "Kalender - Tage im Monat - Anteil vergangene Tage im Monat", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayMonthFutureCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl kommender Tage im Monat", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthFutureShare, 0, fC, { name: "Kalender - Tage im Monat - Anteil kommender Tage im Monat", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayMonthNumber, 0, fC, { name: "Kalender - Tage im Monat - Nummer", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthEven, false, fC, { name: "Kalender - Tage im Monat - Nummer gerade", type: "boolean", role: "indicator" }); const idDayYearPastCount = path + ".Tag.Jahr.Vergangenheit.Anzahl"; const idDayYearPastShare = path + ".Tag.Jahr.Vergangenheit.Anteil"; const idDayYearFutureCount = path + ".Tag.Jahr.Zukunft.Anzahl"; const idDayYearFutureShare = path + ".Tag.Jahr.Zukunft.Anteil"; const idDayYearNumber = path + ".Tag.Jahr.Nummer"; const idDayYearEven = path + ".Tag.Jahr.gerade"; const idDayYearCount = path + ".Tag.Jahr.Anzahl"; createState(idDayYearPastCount, 0, fC, { name: "Kalender - Tage im Jahr - Anzahl vergangene Tage im Jahr", type: "number", role: "level", min: 0, max: 366 }); createState(idDayYearPastShare, 0, fC, { name: "Kalender - Tage im Jahr - Anteil vergangene Tage im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayYearFutureCount, 0, fC, { name: "Kalender - Tage im Jahr - Anzahl kommender Tage im Jahr", type: "number", role: "level", min: 0, max: 366 }); createState(idDayYearFutureShare, 0, fC, { name: "Kalender - Tage im Jahr - Anteil kommender Tage im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayYearNumber, 1, fC, { name: "Kalender - Tage im Jahr - Nummer", type: "number", role: "level", min: 1, max: 366 }); createState(idDayYearEven, false, fC, { name: "Kalender - Tage im Jahr - Nummer gerade", type: "boolean", role: "indicator" }); createState(idDayYearCount, 365, fC, { name: "Kalender - Tage im Jahr - Anzahl", desc: "Anzahl der Tage im Jahr ist abhängig vom Schaltjahr", type: "number", role: "level", min: 365, max: 366 }); /* Datum datuminfo.0.de.datum.sehrkurz (28.4.16) datuminfo.0.de.datum.kurz (28.04.2016) datuminfo.0.de.datum.monattext (28\. April 2016) datuminfo.0.de.datum.tagmonattext (Donnerstag, 28\. April 2016) datuminfo.0.de.datum.tagdermonattext (Donnerstag, der 28\. April 2016) */ const idDateVeryShort = path + ".Datum.sehrkurz"; const idDateShort = path + ".Datum.kurz"; const idDateMonthText = path + ".Datum.monattext"; const idDateDayMonthText = path + ".Datum.tagmonattext"; const idDateDayMonthArtikelText = path + ".Datum.tagdermonattext"; createState(idDateVeryShort, "", fC, { name: "Kalender - Datum als sehr kurzer Text", desc: "DD.M.JJ", type: "string", role: "text" }); createState(idDateShort, "", fC, { name: "Kalender - Datum als kurzer Text", desc: "DD.MM.JJJJ", type: "string", role: "text" }); createState(idDateMonthText, "", fC, { name: "Kalender - Datum als Text mit Monatsname", desc: "DD. Monat JJJJ", type: "string", role: "text" }); createState(idDateDayMonthText, "", fC, { name: "Kalender - Datum als Text mit Wochentag und Monatsname", desc: "Wochentag, DD. Monat JJJJ", type: "string", role: "text" }); createState(idDateDayMonthArtikelText, "", fC, { name: "Kalender - Datum als Text mit Wochentag, Artikel und Monatsname", desc: "Wochentag, der DD. Monat JJJJ", type: "string", role: "text" }); // LOGIK ++++++++++++++++++ function zeit(time) { // log(formatDate(time,"JJJJ.MM.TT SS:mm:ss")); let jetzt = new Date(time); let jahr = jetzt.getFullYear(); let monat = (jetzt.getMonth()+1 < 10) ? "0" + (jetzt.getMonth()+1) : jetzt.getMonth()+1; let tag = jetzt.getDate(); let tag_lang = (jetzt.getDate() < 10) ? "0" + jetzt.getDate() : jetzt.getDate(); let wochentag = jetzt.getDay(); // startet am Sonntag mit 0 let stunde = (jetzt.getHours() < 10) ? "0" + jetzt.getHours() : jetzt.getHours(); let minute = (jetzt.getMinutes() < 10) ? "0" + jetzt.getMinutes() : jetzt.getMinutes(); let sekunde = (jetzt.getSeconds() < 10) ? "0" + jetzt.getSeconds() : jetzt.getSeconds(); return { "Jahr" : jahr, "Monat" : monat, "Monat_gerade" : (monat%2 === 0) ? true : false, "Tag" : tag, "Tag_lang" : tag_lang, "Wochentag" : wochentag, "Stunde" : stunde, "Minute" : minute, "Sekunde" : sekunde }; } function ermittleQuartal(time) { //let z = new Date (time); let y = time.getMonth(); // Monat 0 - 11 let q = 0; switch (y) { case 0: // Jan case 1: case 2: q = 1; break; case 3: // Apr case 4: case 5: q = 2; break; case 6: // Jul case 7: case 8: q = 3; break; case 9: // Okt case 10: case 11: q = 4; break; default: q = 0; break; } return({ "count": q, "even" : (q%2 === 0) ? true : false }); } function ermittleTagDesJahres (time) { var heutestart = new Date(time.setHours(0,0,0,0)); var Jahr = heutestart.getFullYear(); var neujahr = new Date(Jahr,0,1); var difftage = (heutestart - neujahr) / (24*60*60*1000) + 1; var tag = Math.ceil(difftage); return(tag); } function ermittleKW(time) { // http://www.web-toolbox.net/webtoolbox/datum/code-kalenderwocheaktuell.htm // Woche, die den ersten Donnerstag enthält https://de.wikipedia.org/wiki/Woche var KWDatum = new Date(time); var DonnerstagDat = new Date(KWDatum.getTime() + (3-((KWDatum.getDay()+6) % 7)) * 86400000); var KWJahr = DonnerstagDat.getFullYear(); var DonnerstagKW = new Date(new Date(KWJahr,0,4).getTime() + (3-((new Date(KWJahr,0,4).getDay()+6) % 7)) * 86400000); var KW = Math.floor(1.5 + (DonnerstagDat.getTime() - DonnerstagKW.getTime()) / 86400000/7); var kalenderwoche = (parseInt(KW,10) < 10) ? "0" + KW : KW; return({ "kalenderwocheStr" : kalenderwoche, // ggf. führende 0 "kalenderwocheInt" : parseInt(KW,10), // Zahl "even" : (parseInt(KW,10)%2 === 0) ? true: false }); } function leseDatum () { let jetzt = new Date(); // ### Jahr let jjjj = zeit(jetzt).Jahr; let sj = (jjjj % 4 === 0) ? true : false; if (logging) { log("Jahr: " + jjjj); log("Schaltjahr: " + sj); } setState(idYearLeap, sj, true); setState(idYear, jjjj, true); // ### Quartal let quartal = ermittleQuartal(jetzt).count; setState(idQuart, quartal, true); setState(idQuartEven, ermittleQuartal(jetzt).even, true); setState(idQuartPastCount, quartal, true); setState(idQuartPastShare, parseFloat((quartal * 100 / 4).toFixed(dezimals)), true); setState(idQuartFutureCount, 4 - quartal, true); setState(idQuartFutureShare, parseFloat(((4-quartal) * 100 / 4).toFixed(dezimals)), true); // ### Monat //setState("Kalender.Datuminfo.de.Monat.Jahr.Anzahl", {val: 12, ack: true}); // steht fest und wird oben angelegt let mon_vergangen = parseInt(zeit(jetzt).Monat, 10); let monat_gerade = zeit(jetzt).Monat_gerade; setState(idMonthNameShort, monthNameShort[mon_vergangen-1], true); setState(idMonthNameLong, monthNameLong[mon_vergangen-1], true); setState(idMonthNumberCount, mon_vergangen, true); setState(idMonthNumberEven, monat_gerade, true); // Monat im Jahr setState(idMonthYearPastCount, mon_vergangen, true); setState(idMonthYearPastShare, parseFloat((mon_vergangen * 100 / 12).toFixed(dezimals)), true); setState(idMonthYearFutureCount, 12 - mon_vergangen, true); setState(idMonthYearFutureShare, parseFloat(((12-mon_vergangen) * 100 / 12).toFixed(dezimals)), true); // ### Woche // setState("Kalender.Datuminfo.de.Woche.Jahr.Anzahl", {val: 52, ack: true}); let kw = ermittleKW(jetzt).kalenderwocheInt; let silvester = new Date(zeit(jetzt).Jahr, 11, 31, 23, 59, 59, 0); // 31.12.JAHR 23:59:59:0000 Uhr aktuelles Jahr Silvester let lastkw = ermittleKW(silvester).kalenderwocheInt; if (logging) log("KW an Silvester: " + lastkw); setState(idWeekYearNumberCount, kw, true); setState(idWeekYearNumberEven, ermittleKW(jetzt).even, true); // Woche im Jahr setState(idWeekYearPastCount, kw, true); setState(idWeekYearPastShare, parseFloat(((kw * 100) / 52).toFixed(dezimals)), true); let x_kw = (lastkw != 1 ? lastkw : 52); // 52 oder 53 ----- einfach Wert zum weiteren Rechnen let futurekw = x_kw - kw; // wenn letzte KW des Jahres 1 ist, dann von 52 abziehen (können auch mal 53KW sein) setState(idWeekYearFutureCount, futurekw, true); setState(idWeekYearFutureShare, parseFloat(((x_kw - kw) * 100 / x_kw).toFixed(dezimals)), true); // ### Tag // Tag in Woche let wochentag = (zeit(jetzt).Wochentag > 0) ? zeit(jetzt).Wochentag : 7 ; // Wenn Tag nicht 0, dann Tag sonst 7; Mo = 1, ..., So = 7 setState(idDayWeekNameLong, dayWeekNameLong[wochentag], true); setState(idDayWeekNameShort, dayWeekNameShort[wochentag], true); if (logging) log("Wochentag:" + wochentag); setState(idDayWeekNumber, wochentag, true); setState(idDayWeekPastCount, wochentag, true); setState(idDayWeekPastShare, parseFloat((wochentag * 100 / 7).toFixed(dezimals)), true); setState(idDayWeekFutureCount, 7 - wochentag, true); setState(idDayWeekFutureShare, parseFloat(((7 - wochentag) * 100 / 7).toFixed(dezimals)), true); // Tag im Monat let schaltfeb = (sj) ? 29 : 28; let monatslaenge = [31,schaltfeb,31,30,31,30,31,31,30,31,30,31]; let tage_im_monat = parseInt(monatslaenge[mon_vergangen-1],10); setState(idDayMonthCount, tage_im_monat, true); let tage_im_monat_vergangen = zeit(jetzt).Tag; setState(idDayMonthPastCount, tage_im_monat_vergangen, true); setState(idDayMonthPastShare, parseFloat(((tage_im_monat_vergangen * 100) / tage_im_monat).toFixed(dezimals)), true); setState(idDayMonthFutureCount, tage_im_monat- tage_im_monat_vergangen, true); setState(idDayMonthFutureShare, parseFloat(((tage_im_monat - tage_im_monat_vergangen) * 100 / tage_im_monat).toFixed(dezimals)), true); setState(idDayMonthNumber, tage_im_monat_vergangen, true); let tage_im_monat_vergangen_gerade = (tage_im_monat_vergangen % 2 === 0) ? true : false; setState(idDayMonthEven, tage_im_monat_vergangen_gerade, true); // Tag im Jahr let tage_im_jahr_vergangen = ermittleTagDesJahres(jetzt); setState(idDayYearNumber, tage_im_jahr_vergangen, true); let tage_im_jahr_vergangen_gerade = (tage_im_jahr_vergangen % 2 === 0) ? true : false; setState(idDayYearEven, tage_im_jahr_vergangen_gerade, true); let tage_im_jahr = (sj) ? 366 : 365; setState(idDayYearCount, tage_im_jahr, true); setState(idDayYearPastCount, tage_im_jahr_vergangen, true); setState(idDayYearPastShare, parseFloat((tage_im_jahr_vergangen * 100 / tage_im_jahr).toFixed(dezimals)), true); setState(idDayYearFutureCount, tage_im_jahr - tage_im_jahr_vergangen, true); setState(idDayYearFutureShare, parseFloat(((tage_im_jahr - tage_im_jahr_vergangen) * 100 / tage_im_jahr).toFixed(dezimals)), true); // heute Feiertag let name_des_tages = ""; let istFeiertag = false; if (feiertag) { name_des_tages = getState(idHolidayTodayName).val; istFeiertag = getState(idHolidayToday).val; } setState(idDayName, name_des_tages, true); setState(idDayHoliday, istFeiertag, true); // ### Ausgabe + Allgemein // D.M.YY let jj = jjjj - 2000; setState(idDateVeryShort, tage_im_monat_vergangen + "." + mon_vergangen + "." + jj, true); // DD.MM.YYYY let dd = (tage_im_monat_vergangen < 10) ? "0" + tage_im_monat_vergangen : tage_im_monat_vergangen; let mm = (mon_vergangen < 10) ? "0" + mon_vergangen : mon_vergangen; setState(idDateShort, dd + "." + mm + "." + jjjj, true); // D. Monat JJJJ setState(idDateMonthText, tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); // Wochentag, DD. Monat JJJJ setState(idDateDayMonthText, dayWeekNameLong[wochentag] + ", " + tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); // Wochentag, der DD. Monat JJJJ setState(idDateDayMonthArtikelText, dayWeekNameLong[wochentag] + ", der " + tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); log("Kalenderinformation zum heutigen Datum angelegt", "debug"); } setTimeout(leseDatum, 2500); schedule("0 0,12,18 * * *", leseDatum); // Mitternacht und zwei Backups
Hier die Widgets (beziehen sich auch auf die Javascript Instanz 0
[{"tpl":"tplMetroTileToggle","data":{"visibility-cond":"==","visibility-val":1,"hover":false,"transform":"true","bg_class_true":"bg-transparent","bg_class_false":"bg-red","icon_class_true":"","icon_class_false":"","icon_badge_true":"","icon_badge_false":"","badge_bg_class_true":"","badge_bg_class_false":"","brand_bg_class_true":"","brand_bg_class_false":"","select_on_true":true,"label_true":"Skript ein","label_false":"Skript aus","toggle_oid":"javascript.0.Optin_OWL_Lowbat_Sayit","name":"Datuminfo Skript aktivieren/deaktivieren","oid":"javascript.0.scriptEnabled.Kalender_Zeit.Zeit_Datum_Script_für_Widget","badge_top":"0","badge_left":"0","gestures-offsetX":0,"gestures-offsetY":0,"comment":"Achtung! auf Skriptnamen, Pfad und Instanz achten","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"visibility-groups-action":"hide","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"2px","top":"427px","width":"137px","height":"30px","font-family":"","z-index":"20","cursor":"pointer"},"widgetSet":"metro"},{"tpl":"tplHtml","data":{"visibility-cond":"==","visibility-val":"true","refreshInterval":"0","name":"Hintergrund Zusammenfassung ","html":"","label_true":"Optin<br><br>Daten einlesen aktiviert<br><br><span style=\"font-size: 80%\">Parsen von track'n'trace-Daten eingeschaltet</span>","gestures-offsetX":0,"gestures-offsetY":0,"visibility-oid":"javascript.0.scriptEnabled.common.System.Kalender.System_Datuminfo","visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"5px","top":"207px","z-index":"9","color":"rgba(250,250,250,1);","background-color":"rgba(200,0,0,0.5);","border-radius":"","width":"730px","height":"215px","font-size":"16px","font-family":"","text-align":"left","padding-top":"","padding-bottom":"","padding":"","padding-left":""},"widgetSet":"basic"},{"tpl":"tplHtml","data":{"visibility-cond":"==","visibility-val":"true","refreshInterval":"0","name":"Hintergrund Zusammenfassung ","html":"<div style=\"float: left; width: 62%;\">\n <p style='margin: 0; padding: 10px 7px 7px 7px; '>Datum</p>\n <p style=\"margin: 0; padding: 7px 7px 3px 7px; font-size: 200%; \">{javascript.0.Kalender.Datuminfo.de.Datum.tagmonattext}</p>\n</div>\n<div style=\"float: left; width: 12%;\">\n <p style=\"margin: 0; padding: 10px 7px 3px 7px;\">Schaltjahr</p>\n <p style=\"margin: 0; padding: 7px 7px 3px 7px; font-size: 200%\">{javascript.0.Kalender.Datuminfo.de.Jahr.Schaltjahr}</p>\n</div>\n<div style=\"float: left; width: 10%; \">\n <p style=\"margin: 0; padding: 10px 7px 3px 7px;\">Quartal</p>\n <p style=\"margin: 0; padding: 7px 7px 3px 7px; font-size: 200%\">{javascript.0.Kalender.Datuminfo.de.Quartal.Nummer}<span style=\"font-size: 40%\"> / 4</span></p>\n</div>\n<div style=\"float: left; width: 10%; overflow: hidden;\">\n <p style=\"margin: 0; padding: 10px 7px 3px 7px;\">KW</p>\n <p style=\"margin: 0; padding: 7px 7px 3px 7px; font-size: 200%\">{javascript.0.Kalender.Datuminfo.de.Woche.Jahr.Kalenderwoche.Nummer}<span style=\"font-size: 40%\"> / {javascript.0.Kalender.Datuminfo.de.Woche.Jahr.Anzahl}</span></p>\n</div>","label_true":"Optin<br><br>Daten einlesen aktiviert<br><br><span style=\"font-size: 80%\">Parsen von track'n'trace-Daten eingeschaltet</span>","gestures-offsetX":0,"gestures-offsetY":0,"visibility-oid":"javascript.0.scriptEnabled.common.System.Kalender.System_Datuminfo","visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"5px","top":"111px","z-index":"10","color":"rgba(250,250,250,1);","background-color":"rgba(200,0,0,0.5);","border-radius":"","width":"729px","height":"90px","font-size":"16px","font-family":"","text-align":"left","padding-top":"","padding-bottom":"","padding":"","padding-left":""},"widgetSet":"basic"},{"tpl":"tplValueFloatBar","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Nummer","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","min":"1","max":"{javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl}","orientation":"horizontal","color":"#a23f64","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"reverse":false,"name":"Jahresfortschritt Balken","html":"{javascript.2.Paket.trackntrace.Tabelle}"},"style":{"left":"23px","top":"244px","z-index":"30","width":"571px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Zukunft.Anzahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"name":"Jahresfortschritt togo","html_prepend":"to go ","html_append":" Tage"},"style":{"left":"483px","top":"385px","z-index":"30","width":"109px","height":"20px","text-align":"right"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Zukunft.Anzahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"name":"Jahresfortschritt togo","html_prepend":"to go ","html_append":" Tage"},"style":{"left":"485px","top":"271px","z-index":"30","width":"109px","height":"20px","text-align":"right"},"widgetSet":"basic"},{"tpl":"tplValueFloat","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anteil","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","is_comma":"true","factor":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_append_singular":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl} Tagen vorbei","html_append_plural":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl} Tagen vorbei","html_prepend":"","name":"Jahresfortschritt vergangen"},"style":{"left":"25px","top":"386px","width":"471px","height":"20px","z-index":"30"},"widgetSet":"basic"},{"tpl":"tplValueFloat","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anteil","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","is_comma":"true","factor":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_append_singular":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl} Tagen vorbei","html_append_plural":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl} Tagen vorbei","html_prepend":"","name":"Jahresfortschritt vergangen"},"style":{"left":"24px","top":"272px","width":"454px","height":"18px","z-index":"30"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Jahr.Zahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_prepend":"Jahresfortschritt ","name":"Jahresfortschritt Überschrift"},"style":{"left":"25px","top":"218px","z-index":"30","width":"215px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueFloatBar","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Nummer","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","min":"1","max":"{javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl}","orientation":"horizontal","color":"#a23f64","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"reverse":false,"name":"Monatsfortschritt Balken","html":"{javascript.2.Paket.trackntrace.Tabelle}"},"style":{"left":"21px","top":"358px","z-index":"30","width":"571px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Monat.Name.lang","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_prepend":"Monatsfortschritt ","name":"Monatsfortschritt Überschrift"},"style":{"left":"23px","top":"332px","z-index":"30","width":"256px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplHtml","data":{"g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","refreshInterval":"0","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"html":"Nachrichten | Kalender","name":"Überschrift","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"23px","top":"57px","z-index":"25","width":"auto","height":"30px","font-size":"25px"},"widgetSet":"basic"}]
-
Hi Pix,
leider bekomme ich bei deinem Script den fehler
> [error] javascript.0 script.js.common.DatumZeiten.JahresMonatFortschritt compile failed: at script.js.common.DatumZeiten.JahresMonatFortschritt:24
das :24 bedeutet auf zeile 24? Kenne mich noch nicht so aus bei der fehlersucheGrüsse Schweiz
-
das :24 bedeutet auf zeile 24? Kenne mich noch nicht so aus bei der fehlersuche `
hätte ich ir ja auch selbst beantworten können in dem ich einfach mal die Zeile // auskommentiere…
habe die Zeile geändert und jetzt geht es, warum auch immer da ein fehler sein soll im fC
jetzt muss ich nur die Variablen finden...
Grüsse Schweiz
-
Hallo, ich würde auch gerne das Script nutzen. Leider wurde es durch den Umzug des Forums beschädigt. Kann es jemand nochmal hochladen? Wäre super.
Gruß
Torsten -
@Conquest sagte in Gibt es einen Zeit/Datums-Adapter oder Script?:
Hallo, ich würde auch gerne das Script nutzen. Leider wurde es durch den Umzug des Forums beschädigt. Kann es jemand nochmal hochladen? Wäre super.
Gruß
Torsten -
@sigi234 sagte in Gibt es einen Zeit/Datums-Adapter oder Script?:
@Conquest sagte in Gibt es einen Zeit/Datums-Adapter oder Script?:
Hallo, ich würde auch gerne das Script nutzen. Leider wurde es durch den Umzug des Forums beschädigt. Kann es jemand nochmal hochladen? Wäre super.
Gruß
TorstenSuper läuft. Vielen Dank.
-
Das Script ist genial, allerdings erhalte ich mittlerweile folgende Fehlermeldung:
08:10:52.366 error javascript.0 (28205) at Object.leseDatum (script.js.common.Datuminfo:622:5)
Hat jemand eine Idee, was in Zeile 622 hier schief läuft ? Im Log erhalte ich auch etliche Warnungen. Objekte sind alle brav angelegt, aber viele aktualisieren sich nicht mehr. Danke euch!
Script sieht bei mir folgendermaßen aus:
/* System Datuminfo Skript erzeugt Variablen für Datum, Tag, Monat, Jahr, KW, Quartal KW1 = 1. Donnerstag im Jahr 1. Wochentag ist Montag Feiertage aus Adapter iobroker.feiertage 25.02.2016 erstellt von pix 28.04.2016 Prüft ob KW gerade oder ungerade Wochentag als Zahl (deutsches System: Mo = 1, So = 7) 28.05.2016 parseFloat bei toFixed-Werten zugefügt (nach Variablen Typ Warnung) Variablen Typ einiger Objekte geändert 30.09.2018 Optimierung im Code todo Adapter: Grundunterscheidung im Objektbaum: Deutsch (de)/Englisch (en) Jahreszeiten Beispieldatum Donnerstag, 28. Apil 2016 */ const path = "javascript." + instance + ".Kalender.Datuminfo.de"; // Pfad zu Objekten im javascript-Adapter const fC = false; // Objekte neu erstellen? const dezimals = 1; // Dezimalstellen Anteilausgabe const monthNameLong = ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]; const monthNameShort = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]; const dayWeekNameLong = ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"]; // So 1 und 7 const dayWeekNameShort = ["So","Mo","Di","Mi","Don","Fr","Sa","So"]; // ++++++++++ Objekte // Adapter feiertage installiert? const feiertag = true; // Schalter Feiertag-Adapter nutzen oder nicht const idHolidayToday = "feiertage.0.heute.boolean"/*Feiertag heute?*/; const idHolidayTodayName = "feiertage.0.heute.Name"/*Feiertag heute - Name*/; // AB HIER NIX MEHR EINSTELLEN // Jahr /* Jahr datuminfo.0.de.jahr.nummer (2020) datuminfo.0.de.jahr.schaltjahr (true) */ const idYear = path + ".Jahr.Zahl"; const idYearLeap = path + ".Jahr.Schaltjahr"; createState(idYear, 0, fC, { name: "Kalender - Jahreszahl", type: "number", role: "value" }); createState(idYearLeap, false, fC, { name: "Kalender - Schaltjahr", type: "boolean", role: "indicator" }); // Quartal const idQuart = path + ".Quartal.Nummer"; const idQuartEven = path + ".Quartal.gerade"; const idQuartPastCount = path + ".Quartal.Vergangenheit.Anzahl"; const idQuartPastShare = path + ".Quartal.Vergangenheit.Anteil"; const idQuartFutureCount = path + ".Quartal.Zukunft.Anzahl"; const idQuartFutureShare = path + ".Quartal.Zukunft.Anteil"; createState(idQuart, 1, fC, { name: "Kalender - Quartal - Nummer", type: "number", min: 1, max: 4, role: "level" }); createState(idQuartEven, { name: "Kalender - Quartal - gerade", type: "boolean", role: "indicator" }); createState(idQuartPastCount, 0, fC, { name: "Kalender - Quartal - Anzahl vergangene Quartale im Jahr", type: "number", min: 0, max: 3, role: "level" }); createState(idQuartPastShare, 0, fC, { name: "Kalender - Quartal - Anteil vergangene Quartale im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idQuartFutureCount, 0, fC, { name: "Kalender - Quartal - Anzahl kommender Quartale im Jahr", type: "number", min: 0, max: 3, role: "level" }); createState(idQuartFutureShare, 0, fC, { name: "Kalender - Quartal - Anteil kommender Quartale im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); /* Monat datuminfo.0.de.monat.name.lang (April) datuminfo.0.de.monat.name.kurz (April) datuminfo.0.de.monat.nummer.deutsch.nummer (4) datuminfo.0.de.monat.nummer.deutsch.gerade (true) datuminfo.0.de.monat.nummer.deutsch.ungerade (false) datuminfo.0.de.monat.nummer.system.nummer (5) datuminfo.0.de.monat.nummer.system.gerade (false) datuminfo.0.de.monat.nummer.system.ungerade (true) datuminfo.0.de.monat.jahr.nummer (4) // deutsch datuminfo.0.de.monat.jahr.anzahl (12) datuminfo.0.de.monat.jahr.vergangenheit.anzahl (4) datuminfo.0.de.monat.jahr.vergangenheit.Anteil (4 von 12) (4*100)/12 datuminfo.0.de.monat.jahr.zukunft.anzahl (8) datuminfo.0.de.monat.jahr.zukunft.Anteil (8 von 12) (8*100)/12 */ const idMonthNameShort = path + ".Monat.Name.kurz"; const idMonthNameLong = path + ".Monat.Name.lang"; const idMonthNumberCount = path + ".Monat.Nummer.Nummer"; const idMonthNumberEven = path + ".Monat.Nummer.gerade"; const idMonthYearCount = path + ".Monat.Jahr.Anzahl"; // steht fest const idMonthYearPastCount = path + ".Monat.Jahr.Vergangenheit.Anzahl"; const idMonthYearPastShare = path + ".Monat.Jahr.Vergangenheit.Anteil"; const idMonthYearFutureCount = path + ".Monat.Jahr.Zukunft.Anzahl"; const idMonthYearFutureShare = path + ".Monat.Jahr.Zukunft.Anteil"; createState(idMonthNameShort, "", fC, { name: "Kalender - Monat - kurze Name", type: "string", role: "text" }); createState(idMonthNameLong, "", fC, { name: "Kalender - Monat - langer Name", type: "string", role: "text" }); createState(idMonthNumberCount, 1, fC, { name: "Kalender - Monat - Nummer", desc: "Januar = 1, ..., Monat Dezember = 12", type: "number", min: 1, max: 12, role: "level" }); createState(idMonthNumberEven, false, fC, { name: "Kalender - Monat - Nummer - gerade", type: "boolean", role: "indicator" }); createState(idMonthYearCount, 12, fC, { name: "Kalender - Monate - Anzahl im Jahr", type: "number", role: "val", min: 12, max: 12 }); createState(idMonthYearPastCount, 0, fC, { name: "Kalender - Monate - Anzahl vergangene Monate im Jahr", type: "number", role: "level", min: 0, max: 11 }); createState(idMonthYearPastShare, Math.round(1/12), fC, { name: "Kalender - Monate - Anteil vergangene Monate im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idMonthYearFutureCount, 0, fC, { name: "Kalender - Monate - Anzahl kommender Monate im Jahr", type: "number", role: "level", min: 0, max: 11 }); createState(idMonthYearFutureShare, Math.round(11/12), fC, { name: "Kalender - Monate - Anteil kommender Monate im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); /* Woche datuminfo.0.de.woche.gesamt (52) datuminfo.0.de.woche.vergangenheit.anzahl (17) datuminfo.0.de.woche.vergangenheit.Anteil (17 von 52) 17*100/52 datuminfo.0.de.woche.zukunft.anzahl (35) datuminfo.0.de.woche.zukunft.Anteil (35 von 52) 35*100/52 datuminfo.0.de.woche.nummer (17) datuminfo.0.de.woche.gerade (true) datuminfo.0.de.woche.ungerade (false) */ const idWeekYearCount = path + ".Woche.Jahr.Anzahl"; // steht fest const idWeekYearNumberCount = path + ".Woche.Jahr.Kalenderwoche.Nummer"; const idWeekYearNumberEven = path + ".Woche.Jahr.Kalenderwoche.gerade"; const idWeekYearPastCount = path + ".Woche.Jahr.Vergangenheit.Anzahl"; const idWeekYearPastShare = path + ".Woche.Jahr.Vergangenheit.Anteil"; const idWeekYearFutureCount = path + ".Woche.Jahr.Zukunft.Anzahl"; const idWeekYearFutureShare = path + ".Woche.Jahr.Zukunft.Anteil"; createState(idWeekYearCount, 52, fC, { name: "Kalender - Wochen im Jahr - Anzahl", type: "number", role: "level" }); createState(idWeekYearPastCount, 0, fC, { name: "Kalender - Wochen - Anzahl vergangene Wochen im Jahr", type: "number", min: 0, max: 52, role: "level" }); createState(idWeekYearPastShare, 0, fC, { name: "Kalender - Wochen - Anteil vergangene Wochen im Jahr", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idWeekYearFutureCount, 0, fC, { name: "Kalender - Wochen - Anzahl kommender Wochen im Jahr", type: "number", min: 0, max: 52, role: "level" }); createState(idWeekYearFutureShare, 0, fC, { name: "Kalender - Wochen - Anteil kommender Wochen im Jahr", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idWeekYearNumberCount, 0, fC, { name: "Kalender - Wochen - Kalenderwoche", type: "number", min: 0, max: 53, unit: "KW", role: "level" }); createState(idWeekYearNumberEven, false, fC, { name: "Kalender - Wochen - Kalenderwoche gerade", type: "boolean", role: "indicator" }); /* Tag datuminfo.0.de.tag.woche.name.lang (Donnerstag) datuminfo.0.de.tag.woche.name.kurz (Do) datuminfo.0.de.tag.woche.nummer.deutsch (4) datuminfo.0.de.tag.woche.nummer.system (4) datuminfo.0.de.tag.woche.vergangenheit.anzahl (4) // deutsches system ab Montag datuminfo.0.de.tag.woche.vergangenheit.Anteil (4 von 7) 4*100/7 datuminfo.0.de.tag.woche.zukunft.anzahl (3) datuminfo.0.de.tag.woche.zukunft.Anteil (3 von 7) 3*100/7 datuminfo.0.de.tag.monat.gesamt (30) // tage im monat datuminfo.0.de.tag.monat.vergangenheit.anzahl (28) // seit monats beginn datuminfo.0.de.tag.monat.vergangenheit.Anteil (28 von 30) 28*100/30 datuminfo.0.de.tag.monat.zukunft.anzahl (2) // bis monatsende datuminfo.0.de.tag.monat.zukunft.Anteil (2 von 30) 2*100/30 datuminfo.0.de.tag.monat.nummer (28) datuminfo.0.de.tag.monat.gerade (true) datuminfo.0.de.tag.monat.ungerade (false) datuminfo.0.de.tag.jahr.nummer (119) datuminfo.0.de.tag.jahr.gerade (true) datuminfo.0.de.tag.jahr.ungerade (false) datuminfo.0.de.tag.jahr.gesamt (366) datuminfo.0.de.tag.jahr.vergangenheit.anzahl (119) // seit jahresbeginn datuminfo.0.de.tag.jahr.vergangenheit.Anteil (119 von 366) 119*100/366 datuminfo.0.de.tag.jahr.zukunft.anzahl (247) // bis jahresende datuminfo.0.de.tag.jahr.zukunft.Anteil (247 von 366) 247*100/366 */ const idDayName = path + ".Tag.Name"; const idDayHoliday = path + ".Tag.Feiertag"; createState(idDayName, "", fC, { name: "Kalender - Name des Tages", type: "string", role: "text" }); createState(idDayHoliday, false, fC, { name: "Kalender - heute Feiertag?", type: "boolean", role: "indicator" }); const idDayWeekNameLong = path + ".Tag.Woche.Name.lang"; const idDayWeekNameShort = path + ".Tag.Woche.Name.kurz"; const idDayWeekNumber = path + ".Tag.Woche.Nummer"; const idDayWeekPastCount = path + ".Tag.Woche.Vergangenheit.Anzahl"; const idDayWeekPastShare = path + ".Tag.Woche.Vergangenheit.Anteil"; const idDayWeekFutureCount = path + ".Tag.Woche.Zukunft.Anzahl"; const idDayWeekFutureShare = path + ".Tag.Woche.Zukunft.Anteil"; createState(idDayWeekNameLong, "", fC, { name: "Kalender - Tag der Woche - langer Name", type: "string", role: "dayofweek" }); createState(idDayWeekNameShort, "", fC, { name: "Kalender - Tag der Woche - kurzer Name", type: "string", role: "dayofweek" }); createState(idDayWeekNumber, 1, fC, { name: "Kalender - Tag der Woche - Nummer", desc: "Mo = 1, ..., Sa = 6, So = 7", type: "number", role: "level", min: 1, max: 7 }); createState(idDayWeekPastCount, 0, fC, { name: "Kalender - Tag der Woche - Anzahl vergangene Tage in der Woche", type: "number", min: 0, max: 6, role: "value" }); createState(idDayWeekPastShare, 0, fC, { name: "Kalender - Tag der Woche - Anteil vergangene Tage in der Woche", type: "number", unit: "%", min: 0, max: 100, role: "level" }); createState(idDayWeekFutureCount, 0, fC, { name: "Kalender - Tag der Woche - Anzahl kommender Tage in der Woche", type: "number", min: 0, max: 6, role: "value" }); createState(idDayWeekFutureShare, 0, fC, { name: "Kalender - Tag der Woche - Anteil kommender Tage in der Woche", type: "number", unit: "%", min: 0, max: 100, role: "level" }); const idDayMonthCount = path + ".Tag.Monat.Anzahl"; const idDayMonthPastCount = path + ".Tag.Monat.Vergangenheit.Anzahl"; const idDayMonthPastShare = path + ".Tag.Monat.Vergangenheit.Anteil"; const idDayMonthFutureCount = path + ".Tag.Monat.Zukunft.Anzahl"; const idDayMonthFutureShare = path + ".Tag.Monat.Zukunft.Anteil"; const idDayMonthNumber = path + ".Tag.Monat.Nummer"; const idDayMonthEven = path + ".Tag.Monat.gerade"; createState(idDayMonthCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl Tage im Monat", type: "number", min: 28, max: 31, role: "level" }); createState(idDayMonthPastCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl vergangene Tage im Monat", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthPastShare, 0, fC, { name: "Kalender - Tage im Monat - Anteil vergangene Tage im Monat", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayMonthFutureCount, 0, fC, { name: "Kalender - Tage im Monat - Anzahl kommender Tage im Monat", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthFutureShare, 0, fC, { name: "Kalender - Tage im Monat - Anteil kommender Tage im Monat", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayMonthNumber, 0, fC, { name: "Kalender - Tage im Monat - Nummer", type: "number", role: "level", min: 0, max: 31 }); createState(idDayMonthEven, false, fC, { name: "Kalender - Tage im Monat - Nummer gerade", type: "boolean", role: "indicator" }); const idDayYearPastCount = path + ".Tag.Jahr.Vergangenheit.Anzahl"; const idDayYearPastShare = path + ".Tag.Jahr.Vergangenheit.Anteil"; const idDayYearFutureCount = path + ".Tag.Jahr.Zukunft.Anzahl"; const idDayYearFutureShare = path + ".Tag.Jahr.Zukunft.Anteil"; const idDayYearNumber = path + ".Tag.Jahr.Nummer"; const idDayYearEven = path + ".Tag.Jahr.gerade"; const idDayYearCount = path + ".Tag.Jahr.Anzahl"; createState(idDayYearPastCount, 0, fC, { name: "Kalender - Tage im Jahr - Anzahl vergangene Tage im Jahr", type: "number", role: "level", min: 0, max: 366 }); createState(idDayYearPastShare, 0, fC, { name: "Kalender - Tage im Jahr - Anteil vergangene Tage im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayYearFutureCount, 0, fC, { name: "Kalender - Tage im Jahr - Anzahl kommender Tage im Jahr", type: "number", role: "level", min: 0, max: 366 }); createState(idDayYearFutureShare, 0, fC, { name: "Kalender - Tage im Jahr - Anteil kommender Tage im Jahr", type: "number", unit: "%", role: "level", min: 0, max: 100 }); createState(idDayYearNumber, 1, fC, { name: "Kalender - Tage im Jahr - Nummer", type: "number", role: "level", min: 1, max: 366 }); createState(idDayYearEven, false, fC, { name: "Kalender - Tage im Jahr - Nummer gerade", type: "boolean", role: "indicator" }); createState(idDayYearCount, 365, fC, { name: "Kalender - Tage im Jahr - Anzahl", desc: "Anzahl der Tage im Jahr ist abhängig vom Schaltjahr", type: "number", role: "level", min: 365, max: 366 }); /* Datum datuminfo.0.de.datum.sehrkurz (28.4.16) datuminfo.0.de.datum.kurz (28.04.2016) datuminfo.0.de.datum.monattext (28. April 2016) datuminfo.0.de.datum.tagmonattext (Donnerstag, 28. April 2016) datuminfo.0.de.datum.tagdermonattext (Donnerstag, der 28. April 2016) */ const idDateVeryShort = path + ".Datum.sehrkurz"; const idDateShort = path + ".Datum.kurz"; const idDateMonthText = path + ".Datum.monattext"; const idDateDayMonthText = path + ".Datum.tagmonattext"; const idDateDayMonthArtikelText = path + ".Datum.tagdermonattext"; createState(idDateVeryShort, "", fC, { name: "Kalender - Datum als sehr kurzer Text", desc: "DD.M.JJ", type: "string", role: "text" }); createState(idDateShort, "", fC, { name: "Kalender - Datum als kurzer Text", desc: "DD.MM.JJJJ", type: "string", role: "text" }); createState(idDateMonthText, "", fC, { name: "Kalender - Datum als Text mit Monatsname", desc: "DD. Monat JJJJ", type: "string", role: "text" }); createState(idDateDayMonthText, "", fC, { name: "Kalender - Datum als Text mit Wochentag und Monatsname", desc: "Wochentag, DD. Monat JJJJ", type: "string", role: "text" }); createState(idDateDayMonthArtikelText, "", fC, { name: "Kalender - Datum als Text mit Wochentag, Artikel und Monatsname", desc: "Wochentag, der DD. Monat JJJJ", type: "string", role: "text" }); // LOGIK ++++++++++++++++++ function zeit(time) { // log(formatDate(time,"JJJJ.MM.TT SS:mm:ss")); let jetzt = new Date(time); let jahr = jetzt.getFullYear(); let monat = (jetzt.getMonth()+1 < 10) ? "0" + (jetzt.getMonth()+1) : jetzt.getMonth()+1; let tag = jetzt.getDate(); let tag_lang = (jetzt.getDate() < 10) ? "0" + jetzt.getDate() : jetzt.getDate(); let wochentag = jetzt.getDay(); // startet am Sonntag mit 0 let stunde = (jetzt.getHours() < 10) ? "0" + jetzt.getHours() : jetzt.getHours(); let minute = (jetzt.getMinutes() < 10) ? "0" + jetzt.getMinutes() : jetzt.getMinutes(); let sekunde = (jetzt.getSeconds() < 10) ? "0" + jetzt.getSeconds() : jetzt.getSeconds(); return { "Jahr" : jahr, "Monat" : monat, "Monat_gerade" : (monat%2 === 0) ? true : false, "Tag" : tag, "Tag_lang" : tag_lang, "Wochentag" : wochentag, "Stunde" : stunde, "Minute" : minute, "Sekunde" : sekunde }; } function ermittleQuartal(time) { //let z = new Date (time); let y = time.getMonth(); // Monat 0 - 11 let q = 0; switch (y) { case 0: // Jan case 1: case 2: q = 1; break; case 3: // Apr case 4: case 5: q = 2; break; case 6: // Jul case 7: case 8: q = 3; break; case 9: // Okt case 10: case 11: q = 4; break; default: q = 0; break; } return({ "count": q, "even" : (q%2 === 0) ? true : false }); } function ermittleTagDesJahres (time) { var heutestart = new Date(time.setHours(0,0,0,0)); var Jahr = heutestart.getFullYear(); var neujahr = new Date(Jahr,0,1); var difftage = (heutestart - neujahr) / (24*60*60*1000) + 1; var tag = Math.ceil(difftage); return(tag); } function ermittleKW(time) { // http://www.web-toolbox.net/webtoolbox/datum/code-kalenderwocheaktuell.htm // Woche, die den ersten Donnerstag enthält https://de.wikipedia.org/wiki/Woche var KWDatum = new Date(time); var DonnerstagDat = new Date(KWDatum.getTime() + (3-((KWDatum.getDay()+6) % 7)) * 86400000); var KWJahr = DonnerstagDat.getFullYear(); var DonnerstagKW = new Date(new Date(KWJahr,0,4).getTime() + (3-((new Date(KWJahr,0,4).getDay()+6) % 7)) * 86400000); var KW = Math.floor(1.5 + (DonnerstagDat.getTime() - DonnerstagKW.getTime()) / 86400000/7); var kalenderwoche = (parseInt(KW,10) < 10) ? "0" + KW : KW; return({ "kalenderwocheStr" : kalenderwoche, // ggf. führende 0 "kalenderwocheInt" : parseInt(KW,10), // Zahl "even" : (parseInt(KW,10)%2 === 0) ? true: false }); } function leseDatum () { let jetzt = new Date(); // ### Jahr let jjjj = zeit(jetzt).Jahr; let sj = (jjjj % 4 === 0) ? true : false; if (logging) { log("Jahr: " + jjjj); log("Schaltjahr: " + sj); } setState(idYearLeap, sj, true); setState(idYear, jjjj, true); // ### Quartal let quartal = ermittleQuartal(jetzt).count; setState(idQuart, quartal, true); setState(idQuartEven, ermittleQuartal(jetzt).even, true); setState(idQuartPastCount, quartal, true); setState(idQuartPastShare, parseFloat((quartal * 100 / 4).toFixed(dezimals)), true); setState(idQuartFutureCount, 4 - quartal, true); setState(idQuartFutureShare, parseFloat(((4-quartal) * 100 / 4).toFixed(dezimals)), true); // ### Monat //setState("Kalender.Datuminfo.de.Monat.Jahr.Anzahl", {val: 12, ack: true}); // steht fest und wird oben angelegt let mon_vergangen = parseInt(zeit(jetzt).Monat, 10); let monat_gerade = zeit(jetzt).Monat_gerade; setState(idMonthNameShort, monthNameShort[mon_vergangen-1], true); setState(idMonthNameLong, monthNameLong[mon_vergangen-1], true); setState(idMonthNumberCount, mon_vergangen, true); setState(idMonthNumberEven, monat_gerade, true); // Monat im Jahr setState(idMonthYearPastCount, mon_vergangen, true); setState(idMonthYearPastShare, parseFloat((mon_vergangen * 100 / 12).toFixed(dezimals)), true); setState(idMonthYearFutureCount, 12 - mon_vergangen, true); setState(idMonthYearFutureShare, parseFloat(((12-mon_vergangen) * 100 / 12).toFixed(dezimals)), true); // ### Woche // setState("Kalender.Datuminfo.de.Woche.Jahr.Anzahl", {val: 52, ack: true}); let kw = ermittleKW(jetzt).kalenderwocheInt; let silvester = new Date(zeit(jetzt).Jahr, 11, 31, 23, 59, 59, 0); // 31.12.JAHR 23:59:59:0000 Uhr aktuelles Jahr Silvester let lastkw = ermittleKW(silvester).kalenderwocheInt; if (logging) log("KW an Silvester: " + lastkw); setState(idWeekYearNumberCount, kw, true); setState(idWeekYearNumberEven, ermittleKW(jetzt).even, true); // Woche im Jahr setState(idWeekYearPastCount, kw, true); setState(idWeekYearPastShare, parseFloat(((kw * 100) / 52).toFixed(dezimals)), true); let x_kw = (lastkw != 1 ? lastkw : 52); // 52 oder 53 ----- einfach Wert zum weiteren Rechnen let futurekw = x_kw - kw; // wenn letzte KW des Jahres 1 ist, dann von 52 abziehen (können auch mal 53KW sein) setState(idWeekYearFutureCount, futurekw, true); setState(idWeekYearFutureShare, parseFloat(((x_kw - kw) * 100 / x_kw).toFixed(dezimals)), true); // ### Tag // Tag in Woche let wochentag = (zeit(jetzt).Wochentag > 0) ? zeit(jetzt).Wochentag : 7 ; // Wenn Tag nicht 0, dann Tag sonst 7; Mo = 1, ..., So = 7 setState(idDayWeekNameLong, dayWeekNameLong[wochentag], true); setState(idDayWeekNameShort, dayWeekNameShort[wochentag], true); if (logging) log("Wochentag:" + wochentag); setState(idDayWeekNumber, wochentag, true); setState(idDayWeekPastCount, wochentag, true); setState(idDayWeekPastShare, parseFloat((wochentag * 100 / 7).toFixed(dezimals)), true); setState(idDayWeekFutureCount, 7 - wochentag, true); setState(idDayWeekFutureShare, parseFloat(((7 - wochentag) * 100 / 7).toFixed(dezimals)), true); // Tag im Monat let schaltfeb = (sj) ? 29 : 28; let monatslaenge = [31,schaltfeb,31,30,31,30,31,31,30,31,30,31]; let tage_im_monat = parseInt(monatslaenge[mon_vergangen-1],10); setState(idDayMonthCount, tage_im_monat, true); let tage_im_monat_vergangen = zeit(jetzt).Tag; setState(idDayMonthPastCount, tage_im_monat_vergangen, true); setState(idDayMonthPastShare, parseFloat(((tage_im_monat_vergangen * 100) / tage_im_monat).toFixed(dezimals)), true); setState(idDayMonthFutureCount, tage_im_monat- tage_im_monat_vergangen, true); setState(idDayMonthFutureShare, parseFloat(((tage_im_monat - tage_im_monat_vergangen) * 100 / tage_im_monat).toFixed(dezimals)), true); setState(idDayMonthNumber, tage_im_monat_vergangen, true); let tage_im_monat_vergangen_gerade = (tage_im_monat_vergangen % 2 === 0) ? true : false; setState(idDayMonthEven, tage_im_monat_vergangen_gerade, true); // Tag im Jahr let tage_im_jahr_vergangen = ermittleTagDesJahres(jetzt); setState(idDayYearNumber, tage_im_jahr_vergangen, true); let tage_im_jahr_vergangen_gerade = (tage_im_jahr_vergangen % 2 === 0) ? true : false; setState(idDayYearEven, tage_im_jahr_vergangen_gerade, true); let tage_im_jahr = (sj) ? 366 : 365; setState(idDayYearCount, tage_im_jahr, true); setState(idDayYearPastCount, tage_im_jahr_vergangen, true); setState(idDayYearPastShare, parseFloat((tage_im_jahr_vergangen * 100 / tage_im_jahr).toFixed(dezimals)), true); setState(idDayYearFutureCount, tage_im_jahr - tage_im_jahr_vergangen, true); setState(idDayYearFutureShare, parseFloat(((tage_im_jahr - tage_im_jahr_vergangen) * 100 / tage_im_jahr).toFixed(dezimals)), true); // heute Feiertag let name_des_tages = ""; let istFeiertag = false; if (feiertag) { name_des_tages = getState(idHolidayTodayName).val; istFeiertag = getState(idHolidayToday).val; } setState(idDayName, name_des_tages, true); setState(idDayHoliday, istFeiertag, true); // ### Ausgabe + Allgemein // D.M.YY let jj = jjjj - 2000; setState(idDateVeryShort, tage_im_monat_vergangen + "." + mon_vergangen + "." + jj, true); // DD.MM.YYYY let dd = (tage_im_monat_vergangen < 10) ? "0" + tage_im_monat_vergangen : tage_im_monat_vergangen; let mm = (mon_vergangen < 10) ? "0" + mon_vergangen : mon_vergangen; setState(idDateShort, dd + "." + mm + "." + jjjj, true); // D. Monat JJJJ setState(idDateMonthText, tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); // Wochentag, DD. Monat JJJJ setState(idDateDayMonthText, dayWeekNameLong[wochentag] + ", " + tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); // Wochentag, der DD. Monat JJJJ setState(idDateDayMonthArtikelText, dayWeekNameLong[wochentag] + ", der " + tage_im_monat_vergangen + ". " + monthNameLong[mon_vergangen-1] + " " + jjjj, true); log("Kalenderinformation zum heutigen Datum angelegt", "debug"); } setTimeout(leseDatum, 2500); schedule("0 0,12,18 * * *", leseDatum); // Mitternacht und zwei Backups
-
Dir fehlt in Zeile 25 eine Deklaration der Variable logging, deswegen meckert das Script.
Die Variable dient zum ein und ausschalten des Log's/* System Datuminfo Skript erzeugt Variablen für Datum, Tag, Monat, Jahr, KW, Quartal KW1 = 1. Donnerstag im Jahr 1. Wochentag ist Montag Feiertage aus Adapter iobroker.feiertage 25.02.2016 erstellt von pix 28.04.2016 Prüft ob KW gerade oder ungerade Wochentag als Zahl (deutsches System: Mo = 1, So = 7) 28.05.2016 parseFloat bei toFixed-Werten zugefügt (nach Variablen Typ Warnung) Variablen Typ einiger Objekte geändert 30.09.2018 Optimierung im Code todo Adapter: Grundunterscheidung im Objektbaum: Deutsch (de)/Englisch (en) Jahreszeiten Beispieldatum Donnerstag, 28. Apil 2016 */ const path = "javascript." + instance + ".Kalender.Datuminfo.de"; // Pfad zu Objekten im javascript-Adapter const fC = false; // Objekte neu erstellen? const logging = true;
-
@pix
Hallo Pix, ich hatte das geniale Widget bereits früher in meinem VIS eingebaut. Nach Umzug auf neues System bekomme ich Dein Widget nicht mehr importiert. Das zugehörige Script habe ich exakt kopiert und es läuft. Beim Import des Widgets erhalte ich die Fehlermeldung:Invaild JSON SytaxError: Unexpected token in JASON at position 12956.
Kannst Du mir vielleicht einen aktuell lauffähigen Export von Script und Widget posten.
Vielen Dank im Voraus,
Grüße Fabian -
Hallo zusammen,
kann mir jemand sagen, ob ich den dazu oben aufgeführten Code komplett so in VIS einfügen kann, also unter "VIS\Widget\Importieren" den Code importieren, oder muss den aufteilen in Hauptansicht, Script und CSS Anteil?
Ich glaube ich habe da ein grundsätzliches Verständnisproblem in Sachen Widgets...?!Danke und Grüße
Fabian
Der Code des Widgets lautet:[{"tpl":"tplMetroTileToggle","data":{"visibility-cond":"==","visibility-val":1,"hover":false,"transform":"true","bg_class_true":"bg-transparent","bg_class_false":"bg-red","icon_class_true":"","icon_class_false":"","icon_badge_true":"","icon_badge_false":"","badge_bg_class_true":"","badge_bg_class_false":"","brand_bg_class_true":"","brand_bg_class_false":"","select_on_true":true,"label_true":"Skript ein","label_false":"Skript aus","toggle_oid":"javascript.0.Optin_OWL_Lowbat_Sayit","name":"Datuminfo Skript aktivieren/deaktivieren","oid":"javascript.0.scriptEnabled.common.System.Kalender.System_Datuminfo","badge_top":"0","badge_left":"0","gestures-offsetX":0,"gestures-offsetY":0,"comment":"Achtung! auf Skriptnamen, Pfad und Instanz achten","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"visibility-groups-action":"hide","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"875px","top":"74px","width":"137px","height":"30px","font-family":"","z-index":"20","cursor":"pointer"},"widgetSet":"metro"},{"tpl":"tplHtml","data":{"g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","refreshInterval":"0","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"html":"Nachrichten | Kalender","name":"Überschrift","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"89px","top":"21px","z-index":"25","width":"auto","height":"30px","font-size":"25px"},"widgetSet":"basic"},{"tpl":"tplValueFloatBar","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Nummer","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","min":"1","max":"{javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl}","orientation":"horizontal","color":"#a23f64","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"reverse":false,"name":"Jahresfortschritt Balken","html":"{javascript.2.Paket.trackntrace.Tabelle}"},"style":{"left":"89px","top":"208px","z-index":"30","width":"571px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Zukunft.Anzahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"name":"Jahresfortschritt togo","html_prepend":"to go ","html_append":" Tage"},"style":{"left":"551px","top":"235px","z-index":"30","width":"109px","height":"20px","text-align":"right"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Jahr.Zahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_prepend":"Jahresfortschritt ","name":"Jahresfortschritt Überschrift"},"style":{"left":"91px","top":"182px","z-index":"30","width":"215px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueFloatBar","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Nummer","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","min":"1","max":"{javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl}","orientation":"horizontal","color":"#a23f64","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"reverse":false,"name":"Monatsfortschritt Balken","html":"{javascript.2.Paket.trackntrace.Tabelle}"},"style":{"left":"87px","top":"322px","z-index":"30","width":"571px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Zukunft.Anzahl","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"name":"Jahresfortschritt togo","html_prepend":"to go ","html_append":" Tage"},"style":{"left":"549px","top":"349px","z-index":"30","width":"109px","height":"20px","text-align":"right"},"widgetSet":"basic"},{"tpl":"tplValueString","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Monat.Name.lang","g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_prepend":"Monatsfortschritt ","name":"Monatsfortschritt Überschrift"},"style":{"left":"89px","top":"296px","z-index":"30","width":"256px","height":"20px"},"widgetSet":"basic"},{"tpl":"tplHtml","data":{"visibility-cond":"==","visibility-val":"true","refreshInterval":"0","name":"Hintergrund Zusammenfassung ","html":"\n ! Datum ! \n ! {javascript.0.Kalender.Datuminfo.de.Datum.tagmonattext} ! \n\n\n ! Schaltjahr ! \n ! {javascript.0.Kalender.Datuminfo.de.Jahr.Schaltjahr} ! \n\n\n ! Quartal ! \n ! {javascript.0.Kalender.Datuminfo.de.Quartal.Nummer} / 4 ! \n\n\n ! KW ! \n ! {javascript.0.Kalender.Datuminfo.de.Woche.Jahr.Kalenderwoche.Nummer} / {javascript.0.Kalender.Datuminfo.de.Woche.Jahr.Anzahl} ! \n","label_true":"Optin ! Daten einlesen aktiviert ! Parsen von track'n'trace-Daten eingeschaltet","gestures-offsetX":0,"gestures-offsetY":0,"visibility-oid":"javascript.0.scriptEnabled.common.System.Kalender.System_Datuminfo","visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"78px","top":"74px","z-index":"10","color":"rgba(250,250,250,1);","background-color":"rgba(200,0,0,0.5);","border-radius":"","width":"779px","height":"90px","font-size":"16px","font-family":"","text-align":"left","padding-top":"","padding-bottom":"","padding":"","padding-left":""},"widgetSet":"basic"},{"tpl":"tplHtml","data":{"visibility-cond":"==","visibility-val":"true","refreshInterval":"0","name":"Hintergrund Zusammenfassung ","html":"","label_true":"Optin ! Daten einlesen aktiviert ! Parsen von track'n'trace-Daten eingeschaltet","gestures-offsetX":0,"gestures-offsetY":0,"visibility-oid":"javascript.0.scriptEnabled.common.System.Kalender.System_Datuminfo","visibility-groups-action":"hide","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0},"style":{"left":"78px","top":"171px","z-index":"9","color":"rgba(250,250,250,1);","background-color":"rgba(200,0,0,0.5);","border-radius":"","width":"779px","height":"215px","font-size":"16px","font-family":"","text-align":"left","padding-top":"","padding-bottom":"","padding":"","padding-left":""},"widgetSet":"basic"},{"tpl":"tplValueFloat","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anteil","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","is_comma":"true","factor":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_append_singular":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl} Tagen vorbei","html_append_plural":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Jahr.Anzahl} Tagen vorbei","html_prepend":"","name":"Jahresfortschritt vergangen"},"style":{"left":"90px","top":"236px","width":"454px","height":"18px","z-index":"30"},"widgetSet":"basic"},{"tpl":"tplValueFloat","data":{"oid":"javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anteil","g_fixed":true,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","is_comma":"true","factor":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"html_append_singular":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl} Tagen vorbei","html_append_plural":"% oder {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Vergangenheit.Anzahl} / {javascript.0.Kalender.Datuminfo.de.Tag.Monat.Anzahl} Tagen vorbei","html_prepend":"","name":"Jahresfortschritt vergangen"},"style":{"left":"91px","top":"350px","width":"471px","height":"20px","z-index":"30"},"widgetSet":"basic"}]
-
-
@efxz
Bei der Umstellung des Forums wurden ältere Beiträge teilweise nicht richtig übernommen. Du kannst melden über die drei Punkte im Beitrag, dann wird das aktualisiert.
Ich habe das für dich schon gemacht...
-
-
-
@Glasfaser
Danke da warst du schneller -
-
@Glasfaser Ich meinte du hast es schneller gesendet, wollte ich auch gerade machen...
-
Achso ......
-
@Glasfaser sagte in Gibt es einen Zeit/Datums-Adapter oder Script?:
@Negalein war schon im Beitrag
leider war das Widget durch die Umstellung dermaßen verhaut.
Vielleicht kann es @pix nochmal hier posten.
-
Kannst du nicht meins einfügen ... ist das gleiche !?