From 311395712367ecc168d634e39d56783626666e78 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Mon, 25 Jun 2018 15:05:40 +0100 Subject: [PATCH] Simplified Date.prototype.getTwelveHours(). --- django/contrib/admin/static/admin/js/core.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/django/contrib/admin/static/admin/js/core.js b/django/contrib/admin/static/admin/js/core.js index b269ebc1a5..eddb40eb29 100644 --- a/django/contrib/admin/static/admin/js/core.js +++ b/django/contrib/admin/static/admin/js/core.js @@ -74,13 +74,7 @@ function findPosY(obj) { (function() { 'use strict'; Date.prototype.getTwelveHours = function() { - var hours = this.getHours(); - if (hours === 0) { - return 12; - } - else { - return hours <= 12 ? hours : hours - 12; - } + return this.getHours() % 12 || 12; }; Date.prototype.getTwoDigitMonth = function() {