Opened 9 years ago

Closed 5 years ago

#4978 closed Bug (fixed)

Admin DateTimeShortcuts.js ISODate

Reported by: fero <luca.ferroni@…> Owned by: xian
Component: contrib.admin Version: master
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


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 @@
     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 Changed 9 years ago by James Bennett

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to xian
Patch needs improvement: unset

Reassigning to xian.

comment:2 Changed 9 years ago by Simon G <dev@…>

Triage Stage: UnreviewedAccepted

comment:3 Changed 6 years ago by Gabriel Hurley

Severity: Normal
Type: Bug

comment:4 Changed 5 years ago by Claude Paroz

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