Начало
Календари
Ежеквартальный Календарь
Показывает текущий месяц, и месяц, предшествующий и предстоящий на каждой стороне.
JavaScript Ежеквартальный Календарь
JavaScript Calendars:Ежеквартальный Календарь
<!-- TWO STEPS TO INSTALL QUARTERLY CALENDAR: 1. Paste the specified coding into the HEAD of your HTML document 2. Put the last code into the BODY of your HTML document --> <!-- STEP ONE: Copy this code into the HEAD your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- Begin var flg = 0; var fs = 1; var bg = "cyan"; M = new Array("January","February", "March","April","May","June", "July","August","September", "October","November","December"); D = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); function getBgn() { pdy = new Date(); // today pmo = pdy.getMonth(); // present month pyr = pdy.getYear(); // present year if (pyr < 2000) // Y2K Fix, Isaac Powell pyr = pyr + 1900; // http://onyx.idbsu.edu/~ipowell yr = yr1 = (pmo==0?pyr-1:pyr); // last month's year mo = (pmo==0?11:pmo-1); // last month bgn = new Date(M[mo]+" 1,"+yr1); // assign to date document.write('
'); Calendar(); // Send last month to screen document.write('
'); yr = pyr; // present year mo = pmo; // present month bgn = new Date(M[mo]+" 1,"+yr); // assign to date Calendar(); // Send this month to screen document.write('
'); yr = (pmo==11?pyr+1:pyr); // next month's year mo = (pmo==11?0:pmo+1); // next month bgn = new Date(M[mo]+" 1,"+yr); // assign to date Calendar(); // Send next month to screen document.write('
'); // Finish up } function Calendar(){ dy = bgn.getDay(); yr = eval(yr); d = "312831303130313130313031"; if (yr / 4 == Math.floor(yr / 4)) { d = d.substring(0, 2) + "29" + d.substring(4, d.length); } pos = (mo * 2); ld = eval(d.substring(pos, pos + 2)); document.write("
" + "
" + M[mo] + " " + yr + "
"); for (var i = 0;i < 7;i ++) { document.write("
" +"
" + D[i] + "
"); } document.write("
"); ctr = 0; for (var i = 0;i < 7; i++){ if (i < dy) { document.write("
" +"
" +"
"); } else { ctr++; document.write("
" + "
" + ctr + "
" + "
"); } } document.write("
"); while (ctr < ld) { for (var i = 0;i < 7; i++){ ctr++; if (ctr > ld){ document.write("
" + "
"); } else { document.write("
" + "
" + ctr + "
" + "
"); } } document.write("
"); } document.write("
"); } // End --> </SCRIPT> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <BODY> <CENTER> <P><B>JavaScript Quarterly Calendar</B> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin getBgn(); // End --> </SCRIPT> </CENTER> <!-- Script Size: 2.49 KB -->