Skip to content
Snippets Groups Projects
Commit 293e475b authored by Tilman Vatteroth's avatar Tilman Vatteroth :robot:
Browse files

zeitanzeige korrigiert

parent 6d77ca54
Branches
No related tags found
No related merge requests found
...@@ -30,6 +30,17 @@ this.checkShowCondition=function() { ...@@ -30,6 +30,17 @@ this.checkShowCondition=function() {
return 0; return 0;
} }
this.dow = function(d) {
if (typeof(d)!='number' || d <= 0 || d >= 7)
return undefined;
return ["So","Mo","Di","Mi","Do","Fr,","Sa"][d];
}
this.getLongMonth = function(month){
if (typeof(month)!='number' || month <= 0 || month >= 12)
return undefined;
return ["Januar","Feburar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"][month];
}
this.show=function() { this.show=function() {
var now = new Date().getTime(); var now = new Date().getTime();
if (!nextMovie || (now > new Date(nextMovie.date).getTime())) if (!nextMovie || (now > new Date(nextMovie.date).getTime()))
...@@ -46,40 +57,20 @@ this.show=function() { ...@@ -46,40 +57,20 @@ this.show=function() {
titleDiv.text(nextMovie.title); titleDiv.text(nextMovie.title);
var d = new Date(nextMovie.date); var d = new Date(nextMovie.date);
var tag = d.getDate(); var tag = d.getDate();
tag = tag<10?"0"+tag:tag; var h = d.getHours();
zeitDiv.text(tag+". "+this.getLongMonth(d.getMonth())+" "+ d.getFullYear() + " " + d.toLocaleTimeString()); var m = d.getMinutes();
this.resize();
}
}
this.getLongMonth = function(month){ tag = tag < 10 ? "0" + tag : tag;
switch(month) h = h < 10 ? "0" + h : h;
{ m = m < 10 ? "0" + m : m;
case 1:
return "Januar"; zeitDiv.text(
case 2: this.dow(d.getDay()) + ", " +
return "Feburar"; tag + ". " +
case 3: this.getLongMonth(d.getMonth()) + " " +
return "März"; d.getFullYear() + " " +
case 4: h + ":" + m
return "April"; );
case 5: this.resize();
return "Mai";
case 6:
return "Juni";
case 7:
return "Juli";
case 8:
return "August";
case 9:
return "September";
case 10:
return "Oktober";
case 11:
return "November";
case 12:
return "Dezember";
default:
return "undefined";
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment