From 2eb6c671b0e4d3d0a080df364d83ace1095edf04 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 26 Mar 2007 07:52:44 +0000 Subject: [PATCH] Added required js functions for start/stop of vacation messages git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5879 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/calendar.js | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/html/include/calendar.js b/html/include/calendar.js index 7852d9ba2..2e4d5e602 100644 --- a/html/include/calendar.js +++ b/html/include/calendar.js @@ -171,3 +171,51 @@ 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); + } + } + -- 2.30.2