Author: russellm
Date: 2010-05-12 06:00:12 -0500 (Wed, 12 May 2010)
New Revision: 13239

Modified:
   django/trunk/django/contrib/admin/media/js/core.js
Log:
Fixed #13486 -- Corrected handling of %I in admin javascript version of 
strftime. Thanks to Bufke for the report, and jmil for the solution.

Modified: django/trunk/django/contrib/admin/media/js/core.js
===================================================================
--- django/trunk/django/contrib/admin/media/js/core.js  2010-05-11 21:46:39 UTC 
(rev 13238)
+++ django/trunk/django/contrib/admin/media/js/core.js  2010-05-12 11:00:12 UTC 
(rev 13239)
@@ -78,7 +78,7 @@
             curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
             obj = obj.offsetParent;
         }
-        // IE offsetParent does not include the top-level 
+        // IE offsetParent does not include the top-level
         if (isIE && obj.parentElement){
             curleft += obj.offsetLeft - obj.scrollLeft;
         }
@@ -95,7 +95,7 @@
             curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
             obj = obj.offsetParent;
         }
-        // IE offsetParent does not include the top-level 
+        // IE offsetParent does not include the top-level
         if (isIE && obj.parentElement){
             curtop += obj.offsetTop - obj.scrollTop;
         }
@@ -116,7 +116,13 @@
 }
 
 Date.prototype.getTwelveHours = function() {
-    return (this.getHours() <= 12) ? this.getHours() : 24 - this.getHours();
+    hours = this.getHours();
+    if (hours == 0) {
+        return 12;
+    }
+    else {
+        return hours <= 12 ? hours : hours-12
+    }
 }
 
 Date.prototype.getTwoDigitMonth = function() {

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to