summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-05-12 11:00:12 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-05-12 11:00:12 +0000
commit23976fa4b53a84bb3cbc5db070fbc6a1784d5e1d (patch)
treef6b93d30cabdf7a2133ab39727040b31ba598270
parentb6f0fa586b88299a851870df9c23bce1d5cb2f90 (diff)
Fixed #13486 -- Corrected handling of %I in admin javascript version of strftime. Thanks to Bufke for the report, and jmil for the solution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/admin/media/js/core.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/django/contrib/admin/media/js/core.js b/django/contrib/admin/media/js/core.js
index 555847e165..3ca8ad0f9a 100644
--- a/django/contrib/admin/media/js/core.js
+++ b/django/contrib/admin/media/js/core.js
@@ -78,7 +78,7 @@ function findPosX(obj) {
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 @@ function findPosY(obj) {
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.getCorrectYear = function() {
}
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() {