Ticket #6487: 0013-Add-previous-next-year-links-in-JS-calendar.patch

File 0013-Add-previous-next-year-links-in-JS-calendar.patch, 3.0 KB (added by Bastian Kleineidam <calvin@…>, 17 years ago)
  • django/contrib/admin/media/js/admin/DateTimeShortcuts.js

    From f4b7ac7bb0ebc3750a6aadacc84f96287ecc2ee9 Mon Sep 17 00:00:00 2001
    From: Bastian Kleineidam <calvin@debian.org>
    Date: Fri, 25 Jan 2008 19:03:48 +0100
    Subject: Add previous/next year links in JS calendar
    
    Add links to the previous and next year in the JavaScript
    calendar.
    
    Signed-off-by: Bastian Kleineidam <calvin@debian.org>
    
    diff --git a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js
    index 6063836..aeaac15 100644
    a b var DateTimeShortcuts = {  
    154154        addEvent(cal_box, 'click', DateTimeShortcuts.cancelEventPropagation);
    155155
    156156        // next-prev links
    157         var cal_nav = quickElement('div', cal_box, '');
    158         var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');');
    159         cal_nav_prev.className = 'calendarnav-previous';
    160         var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');');
    161         cal_nav_next.className = 'calendarnav-next';
     157        var cal_nav_prev_year = quickElement('a', cal_nav, '<<', 'href', 'javascript:DateTimeShortcuts.drawPrevYear('+num+');');
     158        cal_nav_prev_year.className = 'calendarnav-previous calnav-prev1';
     159        var cal_nav_prev_month = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrevMonth('+num+');');
     160        cal_nav_prev_month.className = 'calendarnav-previous calnav-prev2';
     161        var cal_nav_next_month = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNextMonth('+num+');');
     162        cal_nav_next_month.className = 'calendarnav-next calnav-next2';
     163        var cal_nav_next_year = quickElement('a', cal_nav, '>>', 'href', 'javascript:DateTimeShortcuts.drawNextYear('+num+');');
     164        cal_nav_next_year.className = 'calendarnav-next calnav-next1';
    162165
    163166        // main box
    164167        var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num);
    var DateTimeShortcuts = {  
    217220    dismissCalendar: function(num) {
    218221        document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
    219222    },
    220     drawPrev: function(num) {
     223    drawPrevMonth: function(num) {
    221224        DateTimeShortcuts.calendars[num].drawPreviousMonth();
    222225    },
    223     drawNext: function(num) {
     226    drawNextMonth: function(num) {
    224227        DateTimeShortcuts.calendars[num].drawNextMonth();
    225228    },
     229    drawPrevYear: function(num) {
     230        DateTimeShortcuts.calendars[num].drawPreviousYear();
     231    },
     232    drawNextYear: function(num) {
     233        DateTimeShortcuts.calendars[num].drawNextYear();
     234    },
    226235    handleCalendarCallback: function(num) {
    227236        return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = y+'-'+m+'-'+d; document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
    228237    },
Back to Top