Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<script type="text/javascript">
Array.prototype.count = function() {
return this.length;
};
var today = new Date();
function writeTable(elm, type) {
if(!elm ) {
monat = today.getMonth();
jahr = today.getFullYear();
} else {
switch(type) {
case "monat":
today.setMonth(elm);
monat = today.getMonth();
jahr = today.getFullYear();
break;
case "jahr":
today.setFullYear(elm);
jahr = today.getFullYear();
monat = today.getMonth();
break;
}
}
var datum = today.getDate();
var tag = today.getDay();
today.setDate(1);
var anfangstag = today.getDay();
tage = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"];
monate = ["Januar","Februar","Maerz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
var output = '<select name="monat" onchange="writeTable(this.value, \'monat\')">';
for(i = 0; i < monate.count(); i++) {
if(i == monat) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + i + ">" + monate[i] + "</option>";
}
output = output + "</select>";
var selecter = "";
var Jahrx = jahr +5;
var xJahr = jahr - 5;
output = output + '<select name="jahr" onchange="writeTable(this.value, \'jahr\')">';
for(x = xJahr; x <= Jahrx; x++) {
if(x == jahr) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + x + ">" + x + "</option>";
}
output = output + "</select><br /><table border=1><tr><td colspan=\"7\" align=\"center\">" + monate[monat] + " " + jahr +"</td></tr><tr>";
for(t = 0; t <= 6; t++) {
output = output + "<td style=\"width:25px\" align=\"center\">" + tage[t] + "</td>";
}
output = output + "</tr><tr>";
if(anfangstag == 0) {
anfangstag = 7;
}
k = 1;
l = 0;
m = " ";
n = 7;
var end = "go!";
for(j = 1; j <= 9; j++) {
k++;
if((j == anfangstag) && (l < 32)) {
l++;
if(m == " ") {
m = 0;
}
}
if(l > 0) {
if(m < 31) {
m++;
} else {
j = 9;
l = 0;
m = " ";
}
}
output = output + "<td>" + m + "</td>";
if(j == n) {
j = 1;
output = output + "</tr><tr>";
n = 8;
}
if(k == 43) {
j = 9;
}
}
output = output + "</tr></table>";
document.write(output);
}
</script>
<body onload="writeTable(10, 'monat');">
<html>
<head>
<title>Kalender</title>
<script type="text/javascript">
<!--
Array.prototype.count = function() {
return this.length;
};
var today = new Date();
function writeTable(month, year) {
if(!month ) {
monat = today.getMonth();
jahr = today.getFullYear();
} else {
today.setMonth(month);
monat = today.getMonth();
today.setFullYear(year);
jahr = today.getFullYear();
}
var datum = today.getDate();
var tag = today.getDay();
today.setDate(1);
var anfangstag = today.getDay();
tage = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"];
monate = ["Januar","Februar","Maerz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
var output = '<select name="monat" id="monat" onchange="updateTable()">';
for(i = 0; i < monate.count(); i++) {
if(i == monat) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + i + ">" + monate[i] + "</option>";
}
output = output + "</select>";
var selecter = "";
var Jahrx = jahr +5;
var xJahr = jahr - 5;
output = output + '<select name="jahr" id="monat" onchange="updateTable()">';
for(x = xJahr; x <= Jahrx; x++) {
if(x == jahr) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + x + ">" + x + "</option>";
}
output = output + "</select><br /><table border=1><tr><td colspan=\"7\" align=\"center\">" + monate[monat] + " " + jahr +"</td></tr><tr>";
for(t = 0; t <= 6; t++) {
output = output + "<td style=\"width:25px\" align=\"center\">" + tage[t] + "</td>";
}
output = output + "</tr><tr>";
if(anfangstag == 0) {
anfangstag = 7;
}
var endtag = 0;
if((monat == 0) || (monat == 2) || (monat == 4) || (monat == 6) || (monat == 7) || (monat == 9) || (monat == 11)) {
endtag = 31
}
if((monat == 3) || (monat == 5) || (monat == 8) || (monat == 10)) {
endtag = 30
}
if(monat == 2) {
if( jahr % 4 == 0 && ( jahr % 100 != 0 || jahr % 400 == 0)) {
endtag = 29
} else {
endtag = 28
}
}
k = 1;
l = 0;
m = " ";
n = 7;
endtagp1 = endtag + 1;
var end = "go!";
for(j = 1; j <= 9; j++) {
k++;
if((j == anfangstag) && (l < endtagp1)) {
l++;
if(m == " ") {
m = 0;
}
}
if(l > 0) {
if(m < endtag) {
m++;
} else {
j = 9;
l = 0;
m = " ";
}
}
output = output + "<td>" + m + "</td>";
if(j == n) {
j = 1;
output = output + "</tr><tr>";
n = 8;
}
if(k == 43) {
j = 9;
}
}
output = output + "</tr></table>";
document.write(output);
}
function updateTable() {
if(document.all) {
monatid = document.getElementById("monat");
jahrid = document.getElementById("jahr");
} else {
monatid = monat;
jahrid = jahr;
}
month = document.monatid.value;
year = ducument.jahrid.value;
writeTable(month, year);
}
-->
</script>
</head>
<body onload="writeTable();">
</body>
</html>
<html>
<head>
<title>Kalender</title>
<script type="text/javascript">
Array.prototype.count = function() {
return this.length;
}
function updateTable() {
for (i = 0; i < document.Auswahl.jahr.length; ++i) {
if (document.Auswahl.jahr.options[i].selected == true)
year = document.Auswahl.jahr.options[i].value;
}
for (i = 0; i < document.Auswahl.monat.length; ++i) {
if (document.Auswahl.monat.options[i].selected == true)
month = document.Auswahl.monat.options[i].value;
}
writeTable(month, year);
}
var today = new Date();
function writeTable(month, year) {
if(!month ) {
monat = today.getMonth();
heutemonat = monat;
jahr = today.getFullYear();
heutejahr = jahr;
} else {
var heutemonat = today.getMonth();
today.setMonth(month);
monat = today.getMonth();
var heutejahr = today.getFullYear();
today.setFullYear(year);
jahr = today.getFullYear();
}
var datum = today.getDate();
var tag = today.getDay();
today.setDate(1);
var anfangstag = today.getDay();
tage = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"];
monate = ["Januar","Februar","Maerz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
var output = '<form name="Auswahl"><select name="monat" id="monat" onchange="updateTable()" style="width:136px;">';
for(i = 0; i < monate.count(); i++) {
if(i == monat) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + i + ">" + monate[i] + "</option>";
}
output = output + "</select>";
var selecter = "";
var Jahrx = jahr +5;
var xJahr = jahr - 5;
output = output + '<select name="jahr" id="jahr" onchange="updateTable()">';
for(x = xJahr; x <= Jahrx; x++) {
if(x == jahr) {
var selecter = "selected";
} else {
var selecter = "";
}
output = output + "<option " + selecter + " value=" + x + ">" + x + "</option>";
}
output = output + "</select><br /><table style=\"border: 1px solid #999999\" cellspacing=\"0\" cellpadding=\"0\"><tr><td colspan=\"7\" align=\"center\" style=\"border: 1px solid #999999; background-color: #0379C2; color: #FFFFFF; font-weight: bold;\" >" + monate[monat] + " " + jahr +"</td></tr><tr>";
for(t = 0; t <= 6; t++) {
output = output + "<td style=\"width:25px; border: 1px solid #999999\" align=\"center\">" + tage[t] + "</td>";
}
output = output + "</tr><tr>";
if(anfangstag == 0) {
anfangstag = 7;
}
var endtag = 0;
if((monat == 0) || (monat == 2) || (monat == 4) || (monat == 6) || (monat == 7) || (monat == 9) || (monat == 11)) {
endtag = 31
}
if((monat == 3) || (monat == 5) || (monat == 8) || (monat == 10)) {
endtag = 30
}
if(monat == 1) {
if( jahr % 4 == 0 && ( jahr % 100 != 0 || jahr % 400 == 0)) {
endtag = 29
} else {
endtag = 28
}
}
k = 1;
l = 0;
m = " ";
n = 7;
o = 0;
h = 6;
endtagp1 = endtag + 1;
var end = "go!";
for(j = 1; j <= 9; j++) {
k++;
if((j == anfangstag) && (l < endtagp1) && (o != 1)) {
l++;
if(m == " ") {
m = 0;
}
}
if(l > 0) {
if(m < endtag) {
m++;
} else {
m = " ";
o = 1;
}
}
if((o == 1) && (j == 9)) {
output = output + "</tr>";
} else {
if((j == h) || (j == 8)) {
h = 7;
feiertagclr = "#FF0000";
} else {
feiertagclr = "#000000";
}
if((datum == m)&& (heutemonat == monat) && (heutejahr == jahr)){
todayclr = "#CACACA";
} else {
todayclr = "#FFFFFF";
}
output = output + "<td align=center style=\"border: 1px solid #999999; background-color: " + todayclr + "; color: " + feiertagclr + "\" >" + m + "</td>";
}
if((j == n) && (o != 1)){
j = 1;
output = output + "</tr><tr>";
n = 8;
}
if(k == 43) {
j = 9;
}
}
output = output + "</tr></table></form>";
document.body.innerHTML = output;
}
</script>
<style>
table {
font-family: Tahoma, Verdana, Sans-Serif;
text-decoration: none;
font-weight: normal;
font-size: 12px;
}
select {
border: 1px solid #999999;
}
</style>
</head>
<body onload="writeTable();">
</body>
</html>