Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding trailing semicolons to admin date and time widgets JavaScript …

…(Refs [12030]). Some whitespace cleanup.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dab87431935458203b5268093f0d766167633a95 1 parent 6642060
Jannis Leidel authored January 01, 2010
33  django/contrib/admin/media/js/admin/DateTimeShortcuts.js
@@ -80,10 +80,10 @@ var DateTimeShortcuts = {
80 80
         quickElement('h2', clock_box, gettext('Choose a time'));
81 81
         time_list = quickElement('ul', clock_box, '');
82 82
         time_list.className = 'timelist';
83  
-        quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + gettext('TIME_INPUT_FORMATS') + "'));")
84  
-        quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));")
85  
-        quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));")
86  
-        quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));")
  83
+        quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
  84
+        quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
  85
+        quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
  86
+        quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + gettext('TIME_INPUT_FORMATS') + "'));");
87 87
 
88 88
         cancel_p = quickElement('p', clock_box, '');
89 89
         cancel_p.className = 'calendar-cancel';
@@ -195,20 +195,19 @@ var DateTimeShortcuts = {
195 195
     openCalendar: function(num) {
196 196
         var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num)
197 197
         var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName+num)
198  
-	var inp = DateTimeShortcuts.calendarInputs[num];
  198
+        var inp = DateTimeShortcuts.calendarInputs[num];
199 199
 
200  
-	// Determine if the current value in the input has a valid date.
201  
-	// If so, draw the calendar with that date's year and month.
202  
-	if (inp.value) {
203  
-	    var date_parts = inp.value.split('-');
204  
-	    var year = date_parts[0];
205  
-	    var month = parseFloat(date_parts[1]);
206  
-	    if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) {
207  
-		DateTimeShortcuts.calendars[num].drawDate(month, year);
208  
-	    }
209  
-	}
  200
+        // Determine if the current value in the input has a valid date.
  201
+        // If so, draw the calendar with that date's year and month.
  202
+        if (inp.value) {
  203
+            var date_parts = inp.value.split('-');
  204
+            var year = date_parts[0];
  205
+            var month = parseFloat(date_parts[1]);
  206
+            if (year.match(/\d\d\d\d/) && month >= 1 && month <= 12) {
  207
+                DateTimeShortcuts.calendars[num].drawDate(month, year);
  208
+            }
  209
+        }
210 210
 
211  
-    
212 211
         // Recalculate the clockbox position
213 212
         // is it left-to-right or right-to-left layout ?
214 213
         if (getStyle(document.body,'direction')!='rtl') {
@@ -244,7 +243,7 @@ var DateTimeShortcuts = {
244 243
         format = format.replace('\n', '\\n');
245 244
         format = format.replace('\t', '\\t');
246 245
         format = format.replace("'", "\\'");
247  
-        return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = new Date(y, m-1, d).strftime('"+format+"');document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}"
  246
+        return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = new Date(y, m-1, d).strftime('"+format+"');document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
248 247
     },
249 248
     handleCalendarQuickLink: function(num, offset) {
250 249
        var d = new Date();

0 notes on commit dab8743

Please sign in to comment.
Something went wrong with that request. Please try again.