Kamis, 14 Maret 2013

KODE KALENDER


<script language='javascript' type='text/javascript'>
    var fifteenth = new Array('Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu');
    var sixteenth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    var seventeenth = new Date();
    var eighteenth = seventeenth.getMonth();
    var nineteenth = seventeenth.getDay();
    var first2 = seventeenth.getDate();
    var second2 = sixteenth[eighteenth];
    if (eighteenth == 1) {  var third2 = seventeenth.getYear();
    if (third2%4 == 0) second2 = 29;}
    document.write("<table border='0' bgcolor='#90c0f0' cellspacing='1' cellpadding='1'>");document.write('<tr>');
    for (var fourth2=0; fourth2<7; fourth2++) {
    document.write("<td width='30' height='30'>");
    document.write("<div align='center'>" + fifteenth[fourth2] + "</div>");
    document.write('</td>');}
    document.write('</tr>');
    var fifth2 = 0;
    var sixth2 = 1;
    var fifteenth3 = nineteenth - first2%7 + 1;
    if (fifteenth3 < 0) fifteenth3 += 7;
    var sixteenth3 = parseInt((fifteenth3 + second2)/7);
    if ((fifteenth3 + second2)%7 != 0) sixteenth3++;
    for (var fourth2=sixteenth3; fourth2>0; fourth2--) {
    document.write('<tr>');
    for (var seventeenth3=7; seventeenth3>0; seventeenth3--) {
    document.write('<td>');  
    if (fifth2<fifteenth3 || sixth2>second2) {
    document.write("<div align='center'></div>");      fifth2++;    }  
    else {    
    if (sixth2 == first2)
    document.write("<div align='center'><font color='blue'>[" + sixth2 + "]</font></div>");    
    else document.write("<div align='center'>" + sixth2 + "</div>");      sixth2++;    }
    document.write('</td>')  }
    document.write('</tr>');}
    document.write('</table>');
    </script>

Tidak ada komentar:

Poskan Komentar