JSFiddle - React, Tailwind, and code Playground
by Ayri Rin
JavaScript
var i;
var currentdate = new Date();
var months = new Array( "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" );
var weekday = new Array( "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс" );
var currentmonth = currentdate.getMonth();
for(i=0;i<12;i++) {
if( document.location.href.indexOf( encodeURIComponent(months[i]) ) != -1 ) {
currentmonth = i;
}
}
var currentyear = currentdate.getFullYear();
for(i=1900;i<2100;i++)
if( document.location.href.indexOf( (new Number(i)).toString() ) != -1 )
currentyear = i;
var monthcountday = new Array( 31, (((currentyear%4) == 0 ) ? 29 : 28),
31, 30, 31, 30, 31, 31, 30, 31, 30 ,31 );
var firstday = ((new Date(currentyear,currentmonth,1)).getDay()+6)%7;
document.write( "<h1 style='text-align:center'>Календарь</h1>"
+ "<div align='center'>"
+ "<div><a href='calendar.html?"+encodeURIComponent(months[currentmonth])+","+(currentyear-1)+"'>"+(currentyear-1)+"</A> "
+ "<strong>" + currentyear + "</strong>"
+ " <a href='calendar.html?"+encodeURIComponent(months[currentmonth])+","+(currentyear+1)+"'>"+(currentyear+1)+"</a></div>"
+ ((currentmonth!=0) ? "<div><a href='calendar.html?"+encodeURIComponent(months[currentmonth-1])+","+currentyear+"'>"+months[currentmonth-1]+"</a> "
: "<div><a href='calendar.html?"+encodeURIComponent(months[11])+","+(currentyear-1)+"'>"+months[11]+" of "+(currentyear-1)+"</A> ")
+ "<strong>" + months[currentmonth] +...