Opened 17 years ago

Closed 13 years ago

#4978 closed Bug (fixed)

Admin DateTimeShortcuts.js ISODate

Reported by: fero <luca.ferroni@…> Owned by: xian
Component: contrib.admin Version: dev
Severity: Normal Keywords: datetime calendar isodate date
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

By clicking on a Day in the little calendar I have not an ISODate,
whereas I have an ISODate if I click the "today" link.
I solved the problem with this patch:

--- /usr/lib/python2.4/site-packages/django/contrib/admin/media/js/admin/DateTimeShortcuts.js   2007-06-04 17:58:14.000000000 +0200
+++ static/js/admin/DateTimeShortcuts.js        2007-07-26 11:33:02.459656656 +0200
@@ -223,7 +213,7 @@
         DateTimeShortcuts.calendars[num].drawNextMonth();
     },
     handleCalendarCallback: function(num) {
-        return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = y+'-'+m+'-'+d; document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
+        return "function(y, m, d) { var D = new Date(y,m-1,d); DateTimeShortcuts.calendarInputs["+num+"].value = D.getISODate(); document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
     },
     handleCalendarQuickLink: function(num, offset) {
        var d = new Date();

Change History (4)

comment:1 by James Bennett, 17 years ago

Owner: changed from nobody to xian

Reassigning to xian.

comment:2 by Simon G <dev@…>, 17 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: Bug

comment:4 by Claude Paroz, 13 years ago

Easy pickings: unset
Resolution: fixed
Status: newclosed
UI/UX: unset

It seems this is fixed for some time now. Please reopen if you can reproduce it in up-to-date code.

Note: See TracTickets for help on using tickets.
Back to Top