Ticket #4448: openCalendar_redraw_with_current.diff
File openCalendar_redraw_with_current.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/media/js/admin/DateTimeShortcuts.js
195 195 openCalendar: function(num) { 196 196 var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num) 197 197 var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num) 198 var inp = DateTimeShortcuts.calendarInputs[num]; 199 200 // Determine if the current value in the input has a valid date. 201 // If so, draw the calendar with that date's year and month. 202 if (inp.value) { 203 var date_parts = inp.value.split('-'); 204 var year = date_parts[0]; 205 var month = parseFloat(date_parts[1]); 206 if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) { 207 DateTimeShortcuts.calendars[num].drawDate(month, year); 208 } 209 } 210 198 211 199 212 // Recalculate the clockbox position 200 213 // is it left-to-right or right-to-left layout ?