Simplified Date.prototype.getTwelveHours().

This commit is contained in:
Nick Pope 2018-06-25 15:05:40 +01:00 committed by Tim Graham
parent a25029b336
commit 3113957123
1 changed files with 1 additions and 7 deletions

View File

@ -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() {