index b6f7296c0a97ef7c07a03d07c209ac65ed9350c8..2e4d5e60254ff84376ae795ac3ad29e88391dae1 100644 (file)
--- a/html/include/calendar.js
+++ b/html/include/calendar.js
function populate(objForm,resultForm) {
- yearSel=objForm.year.options[objForm.year.selectedIndex].text;
- monthIx=objForm.month.selectedIndex;
- nextMonthIx=0;
- if(monthIx!=11)
- nextMonthIx=monthIx+1;
-
- nextMonthSel=objForm.month.options[nextMonthIx].value;
- monthSel=objForm.month.options[monthIx].value;
-
- daySel=1;
- if(objForm.day.selectedIndex!=-1)
- daySel=objForm.day.options[objForm.day.selectedIndex].value;
-
- timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
- timeDifference = timeOfDayOne - 86400000;
- timeOfLastDay = new Date(timeDifference);
-
- var daysInMonth = timeOfLastDay.getDate();
-
- if(daySel>daysInMonth) daySel=daysInMonth;
-
- selectedDate= new Date(yearSel,monthSel,daySel);
- for (var i = 0; i < objForm.day.length; i++) {
- objForm.day.options[0] = null;
+ if(objForm.year) {
+ yearSel=objForm.year.options[objForm.year.selectedIndex].text;
+
+ monthIx=objForm.month.selectedIndex;
+ nextMonthIx=0;
+ if(monthIx!=11) {
+ nextMonthIx=monthIx+1;
+ }
+
+ nextMonthSel=objForm.month.options[nextMonthIx].value;
+ monthSel=objForm.month.options[monthIx].value;
+
+ daySel=1;
+ if(objForm.day.selectedIndex!=-1) {
+ daySel=objForm.day.options[objForm.day.selectedIndex].text;
+ }
+
+ timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
+ timeDifference = timeOfDayOne - 86400000;
+ timeOfLastDay = new Date(timeDifference);
+
+ var daysInMonth = timeOfLastDay.getDate();
+
+ if(daySel>daysInMonth) daySel=daysInMonth;
+
+ selectedDate= new Date(yearSel,monthSel,daySel);
+ for (var i = 0; i < objForm.day.length; i++) {
+ objForm.day.options[0] = null;
+ }
+ for (var i = 0; i < daysInMonth; i++) {
+ objForm.day.options[i] = new Option(i+1);
+ }
+ objForm.day.selectedIndex=daySel-1;
+ saveResult(selectedDate,resultForm);
}
- for (var i = 0; i < daysInMonth; i++) {
- objForm.day.options[i] = new Option(i+1);
- }
- objForm.day.selectedIndex=daySel-1;
- saveResult(selectedDate,resultForm);
}
function createResult(objForm,resultForm){
selectedDate= new Date(yearSel,monthSel,daySel);
saveResult(selectedDate,resultForm);
}
+
+ function createResult2(objForm,resultForm){
+ yearSel=objForm.syear.options[objForm.syear.selectedIndex].text;
+ monthIx=objForm.smonth.selectedIndex;
+ monthSel=objForm.smonth.options[monthIx].value;
+ daySel=objForm.sday.options[objForm.sday.selectedIndex].value;
+ selectedDate= new Date(yearSel,monthSel,daySel);
+ saveResult(selectedDate,resultForm);
+ }
+
+function populate2(objForm,resultForm) {
+ if(objForm.syear) {
+ yearSel=objForm.syear.options[objForm.syear.selectedIndex].text;
+
+ monthIx=objForm.smonth.selectedIndex;
+ nextMonthIx=0;
+ if(monthIx!=11) {
+ nextMonthIx=monthIx+1;
+ }
+
+ nextMonthSel=objForm.smonth.options[nextMonthIx].value;
+ monthSel=objForm.smonth.options[monthIx].value;
+
+ daySel=1;
+ if(objForm.sday.selectedIndex!=-1) {
+ daySel=objForm.sday.options[objForm.sday.selectedIndex].text;
+ }
+
+ timeOfDayOne = new Date(yearSel, nextMonthSel, 1);
+ timeDifference = timeOfDayOne - 86400000;
+ timeOfLastDay = new Date(timeDifference);
+
+ var daysInMonth = timeOfLastDay.getDate();
+
+ if(daySel>daysInMonth) daySel=daysInMonth;
+
+ selectedDate= new Date(yearSel,monthSel,daySel);
+ for (var i = 0; i < objForm.sday.length; i++) {
+ objForm.sday.options[0] = null;
+ }
+ for (var i = 0; i < daysInMonth; i++) {
+ objForm.sday.options[i] = new Option(i+1);
+ }
+ objForm.sday.selectedIndex=daySel-1;
+ saveResult(selectedDate,resultForm);
+ }
+ }
+