Ticket #11314: CalUsability.diff
File CalUsability.diff, 1.3 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/media/js/calendar.js
45 45 return days; 46 46 }, 47 47 draw: function(month, year, div_id, callback) { // month = 1-12, year = 1-9999 48 var today = new Date(); 49 var todayDay = today.getDate(); 50 var todayMonth = today.getMonth()+1; 51 var todayYear = today.getFullYear(); 52 var todayClass = ''; 53 48 54 month = parseInt(month); 49 55 year = parseInt(year); 50 56 var calDiv = document.getElementById(div_id); … … 75 81 if (i%7 == 0 && currentDay != 1) { 76 82 tableRow = quickElement('tr', tableBody); 77 83 } 78 var cell = quickElement('td', tableRow, ''); 84 if ((currentDay==todayDay) && (month==todayMonth) && (year==todayYear)) { 85 todayClass='today'; 86 } else { 87 todayClass=''; 88 } 89 var cell = quickElement('td', tableRow, '', 'class', todayClass); 90 79 91 quickElement('a', cell, currentDay, 'href', 'javascript:void(' + callback + '('+year+','+month+','+currentDay+'));'); 80 92 currentDay++; 81 93 }