Ticket #3014: time_with_seconds.diff
File time_with_seconds.diff, 3.6 KB (added by , 18 years ago) |
---|
-
django/contrib/admin/media/js/core.js
119 119 return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes(); 120 120 } 121 121 122 Date.prototype.getTwoDigitSecond = function() { 123 return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); 124 } 125 122 126 Date.prototype.getISODate = function() { 123 127 return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate(); 124 128 } … … 127 131 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); 128 132 } 129 133 134 Date.prototype.getHourMinuteSecond = function() { 135 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond(); 136 } 137 130 138 // ---------------------------------------------------------------------------- 131 139 // String object extensions 132 140 // ---------------------------------------------------------------------------- -
django/contrib/admin/media/js/admin/DateTimeShortcuts.js
44 44 var shortcuts_span = document.createElement('span'); 45 45 inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); 46 46 var now_link = document.createElement('a'); 47 now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute ());");47 now_link.setAttribute('href', "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());"); 48 48 now_link.appendChild(document.createTextNode(gettext('Now'))); 49 49 var clock_link = document.createElement('a'); 50 50 clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');'); … … 80 80 quickElement('h2', clock_box, gettext('Choose a time')); 81 81 time_list = quickElement('ul', clock_box, ''); 82 82 time_list.className = 'timelist'; 83 quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinute ());")84 quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00 ');")85 quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00 ');")86 quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00 ');")83 quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().getHourMinuteSecond());") 84 quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '00:00:00');") 85 quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '06:00:00');") 86 quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", '12:00:00');") 87 87 88 88 cancel_p = quickElement('p', clock_box, ''); 89 89 cancel_p.className = 'calendar-cancel';