Opened 12 years ago

Closed 7 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 11 years ago by James Bennett

Owner: changed from nobody to xian

Reassigning to xian.

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

Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Gabriel Hurley

Severity: Normal
Type: Bug

comment:4 Changed 7 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