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

zeitanzeige korrigiert

parent 6d77ca54
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,17 @@ this.checkShowCondition=function() {
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() {
var now = new Date().getTime();
if (!nextMovie || (now > new Date(nextMovie.date).getTime()))
......@@ -46,40 +57,20 @@ this.show=function() {
titleDiv.text(nextMovie.title);
var d = new Date(nextMovie.date);
var tag = d.getDate();
tag = tag<10?"0"+tag:tag;
zeitDiv.text(tag+". "+this.getLongMonth(d.getMonth())+" "+ d.getFullYear() + " " + d.toLocaleTimeString());
this.resize();
}
}
var h = d.getHours();
var m = d.getMinutes();
this.getLongMonth = function(month){
switch(month)
{
case 1:
return "Januar";
case 2:
return "Feburar";
case 3:
return "März";
case 4:
return "April";
case 5:
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";
tag = tag < 10 ? "0" + tag : tag;
h = h < 10 ? "0" + h : h;
m = m < 10 ? "0" + m : m;
zeitDiv.text(
this.dow(d.getDay()) + ", " +
tag + ". " +
this.getLongMonth(d.getMonth()) + " " +
d.getFullYear() + " " +
h + ":" + m
);
this.resize();
}
}
}
\ 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