From 9d1ec0b5ec98188e88c8087ca3fd94302cb9d778 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Fri, 15 Aug 2008 19:51:45 +0000 Subject: [PATCH] Fixed #5385 -- Made the date returned from the calendar picker consistent with the usual format of dates in the admin. Thanks Petr Marhoun for the ticket and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8390 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/media/js/admin/DateTimeShortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js index 4682a6841a..f57f97e7ee 100644 --- a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js +++ b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js @@ -236,7 +236,7 @@ var DateTimeShortcuts = { 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) { DateTimeShortcuts.calendarInputs["+num+"].value = y+'-'+(m<10?'0':'')+m+'-'+(d<10?'0':'')+d; document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}"; }, handleCalendarQuickLink: function(num, offset) { var d = new Date();