/* Copyright by .:ArTuR:. Author Artur Grzybowski */ var monthsLengths = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var weekdaysNames = new Array('PO','WT','ŚR','CZ','PT','SO','ND'); var monthsNames = new Array('Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'); function signDate(day,month,year,whereSign){ day=((day<10)?'0'+day:day); month=((month<10)?'0'+month:month); change(whereSign,'value',year+'-'+month+'-'+day); } function calendar1(day,month,year,whereSign) { bName = navigator.appName; var calendarCode = ""; if (bName.substring(0,9) == "Microsoft") { calendarCode = calendarCode + "

"; } var calendarCode = calendarCode + "
"; firstDayOfMonth = new Date(year,(month-1),1); var firstDay = firstDayOfMonth.getDay(); if (firstDay == 0) { firstDay = 7; } if(year%4==0) monthsLengths[1]=29; leftLink = "<<"; rightLink = ">>"; calendarCode = calendarCode + ""; leftLink = "<<"; rightLink = ">>"; calendarCode = calendarCode + "
"+leftLink+""+year+""+rightLink+"
"+leftLink+""+monthsNames[month-1]+""+rightLink+"
"; calendarCode = calendarCode + ""; var currentDay = 0; var endDay = 7; while (currentDay"+weekDayName+""; currentDay++; } calendarCode = calendarCode + ""; currentDay = 1; endDay = firstDay; var newWeekDay = 0; while (currentDay < endDay){ background=''; background=(currentDay==6)?'class=\"saturday\"':background; background=(currentDay==7)?'class=\"sunday\"':background; calendarCode = calendarCode + ""; newWeekDay++; currentDay++; } currentDay = 1; endDay = monthsLengths[month-1]; while (currentDay <= endDay){ if (newWeekDay >= 7) { calendarCode = calendarCode + ""; newWeekDay=0; } background=''; // OZNACZENIE ŚWIĄT // STYCZEŃ if (monthsNames[month-1]=='Styczeń'){if (currentDay==1){background='class=\"sunday\"';};}; // MAJ if (monthsNames[month-1]=='Maj'){if ((currentDay==3) || (currentDay==1)){background='class=\"sunday\"';};}; // SIERPIEŃ if (monthsNames[month-1]=='Sierpień'){if (currentDay==15){background='class=\"sunday\"';};}; // LISTOPAD if (monthsNames[month-1]=='Listopad'){if ((currentDay==1) || (currentDay==11)){background='class=\"sunday\"';};}; // GRUDZIEŃ if (monthsNames[month-1]=='Grudzień'){if ((currentDay==25) || (currentDay==26)){background='class=\"sunday\"';};}; //KONIEC OZNACZENIA ŚWIAT background=(newWeekDay==5)?'class=\"saturday\"':background; background=(newWeekDay==6)?'class=\"sunday\"':background; background=((currentDay==17&&month==11&&year==2018))?'class=\"calendar_sign\"':background; calendarCode = calendarCode + ""; newWeekDay++; currentDay++; } while (newWeekDay < 7){ calendarCode = calendarCode + ""; newWeekDay++; } calendarCode = calendarCode + "
 
"+((currentDay<10)?'0'+currentDay:currentDay);+" 
Zamknij
"; change(whereSign+'_create_calendar','html',calendarCode); } function createCalendar1(whereSign) { style(whereSign+'_create_calendar','display','block','none'); calendar1(17,11,2018,whereSign); }