Changeset ca428d in indico
- Timestamp:
- 11/12/09 17:56:33 (4 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 4314aa
- Parents:
- 931922
- git-author:
- Cesar Munoz Orena <cesar.munoz.orena@…> (11/11/09 09:37:51)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (11/12/09 17:56:33)
- Location:
- indico
- Files:
-
- 4 edited
-
MaKaC/webinterface/tpls/RoomBookingPeriodForm.tpl (modified) (2 diffs)
-
MaKaC/webinterface/tpls/RoomBookingSearch4Bookings.tpl (modified) (1 diff)
-
htdocs/js/indico/Legacy/Util.js (modified) (1 diff)
-
htdocs/js/indico/Legacy/validation.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/webinterface/tpls/RoomBookingPeriodForm.tpl
r9033fd rca428d 47 47 var startDate = IndicoUI.Widgets.Generic.dateField_sdate(false,null,['sDay', 'sMonth', 'sYear']); 48 48 $E('sDatePlace').set(startDate); 49 49 50 50 var endDate = IndicoUI.Widgets.Generic.dateField_edate(false,null,['eDay', 'eMonth', 'eYear']); 51 51 $E('eDatePlace').set(endDate); 52 53 /* In case the date changes, we need to check whether the start date is greater than the end date, 54 and if it's so we need to change it */ 55 startDate.observe(function(value) { 56 if ( IndicoUtil.parseDate(startDate.get()) > IndicoUtil.parseDate(endDate.get()) ) { 57 endDate.set(startDate.get()); 58 endDate.dom.onchange(); 59 set_repeatition_comment(); 60 } 61 }); 62 63 endDate.observe(function(value) { 64 if ( IndicoUtil.parseDate(startDate.get()) > IndicoUtil.parseDate(endDate.get()) ) { 65 startDate.set(endDate.get()); 66 startDate.dom.onchange(); 67 set_repeatition_comment(); 68 } 69 }); 52 70 53 71 <% if startDT.day != '': %> … … 65 83 <td class="blacktext"> 66 84 <span id="sDatePlace"></span> 67 <input type="hidden" value="<%= startDT.day %>" name="sDay" id="sDay" onchange="this.form.eDay.value=this.value;if ( validate_period( this.form ) ) { set_repeatition_comment() }"/>68 <input type="hidden" value="<%= startDT.month %>" name="sMonth" id="sMonth" onchange="this.form.eMonth.value=this.value;if ( validate_period( this.form ) ) { set_repeatition_comment() }"/>69 <input type="hidden" value="<%= startDT.year %>" name="sYear" id="sYear" onchange="this.form.eYear.value=this.value;if ( validate_period( this.form ) ) { set_repeatition_comment() }"/>85 <input type="hidden" value="<%= startDT.day %>" name="sDay" id="sDay"/> 86 <input type="hidden" value="<%= startDT.month %>" name="sMonth" id="sMonth"/> 87 <input type="hidden" value="<%= startDT.year %>" name="sYear" id="sYear"/> 70 88 </td> 71 89 </tr> -
indico/MaKaC/webinterface/tpls/RoomBookingSearch4Bookings.tpl
r9033fd rca428d 77 77 var endDate = IndicoUI.Widgets.Generic.dateField_edate(false,null,['eDay', 'eMonth', 'eYear']); 78 78 $E('eDatePlace').set(endDate); 79 80 81 /* In case the date changes, we need to check whether the start date is greater than the end date, 82 and if it's so we need to change it */ 83 startDate.observe(function(value) { 84 if ( IndicoUtil.parseDate(startDate.get()) > IndicoUtil.parseDate(endDate.get()) ) { 85 endDate.set(startDate.get()); 86 endDate.dom.onchange(); 87 } 88 }); 89 90 endDate.observe(function(value) { 91 if ( IndicoUtil.parseDate(startDate.get()) > IndicoUtil.parseDate(endDate.get()) ) { 92 startDate.set(endDate.get()); 93 startDate.dom.onchange(); 94 } 95 }); 79 96 80 97 <% if today.day != '': %> -
indico/htdocs/js/indico/Legacy/Util.js
r626e2c rca428d 251 251 setDate(sdatetime, sdate); 252 252 setTime(sdatetime, stime); 253 254 return sdatetime; 255 }, 256 257 parseDate: function(strDate) { 258 259 var sdatetime = new Date(); 260 var sdate = parseDate(strDate); 261 262 if ( !sdate ) { 263 return null; 264 } 265 266 setTime(sdatetime, [0,0,0,0]) 267 setDate(sdatetime, sdate); 253 268 254 269 return sdatetime; -
indico/htdocs/js/indico/Legacy/validation.js
r9033fd rca428d 141 141 - allowPast : whether to allow dates in the past 142 142 - what : what to validate: 0 - both dates and times, 1 - only dates, 2 - only times 143 143 144 Controls must follow naming conventions: 144 145 sDay, sMonth, sYear, sTime … … 177 178 todayDate = new Date() 178 179 todayDate.setHours( 0, 0, 0, 0 ) 179 if ( sDate.valueOf() > eDate.valueOf() || 180 ( !allowPast && ( sDate.valueOf() < (todayDate).valueOf()) ) ) 180 if ( !allowPast && ( sDate.valueOf() < (todayDate).valueOf()) ) 181 181 { 182 182 f1.eDay.className = f1.eMonth.className = f1.eYear.className = f1.edate.className = 'invalid' 183 183 f1.sDay.className = f1.sMonth.className = f1.sYear.className = f1.sdate.className = 'invalid' 184 184 isValid = false 185 } 185 } 186 186 } 187 187 }
Note: See TracChangeset
for help on using the changeset viewer.
