mirror of
https://github.com/django/django.git
synced 2025-03-06 15:32:33 +00:00
Simplified Date.prototype.getTwelveHours().
This commit is contained in:
parent
a25029b336
commit
3113957123
@ -74,13 +74,7 @@ function findPosY(obj) {
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
Date.prototype.getTwelveHours = function() {
|
Date.prototype.getTwelveHours = function() {
|
||||||
var hours = this.getHours();
|
return this.getHours() % 12 || 12;
|
||||||
if (hours === 0) {
|
|
||||||
return 12;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return hours <= 12 ? hours : hours - 12;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Date.prototype.getTwoDigitMonth = function() {
|
Date.prototype.getTwoDigitMonth = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user