mirror of
https://github.com/samsonjs/strftime.git
synced 2026-04-27 14:57:37 +00:00
Refactoring
This commit is contained in:
parent
51af2bd52a
commit
a2c640098f
1 changed files with 4 additions and 3 deletions
|
|
@ -96,7 +96,7 @@
|
||||||
_date = new Date(_date.getTime() + (_timeZone * 60000));
|
_date = new Date(_date.getTime() + (_timeZone * 60000));
|
||||||
}
|
}
|
||||||
|
|
||||||
return format.replace(/%([-_0]?)(.)/g, processing);
|
return format.replace(/%([-_0]?)([AaBbCDdeFHhIjkLlMmnoPpRrSsTtUuvWwYyZz])/g, processing);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mask = {
|
var mask = {
|
||||||
|
|
@ -160,7 +160,8 @@
|
||||||
return '\n';
|
return '\n';
|
||||||
},
|
},
|
||||||
'o': function () {
|
'o': function () {
|
||||||
return String(_date.getDate()) + ordinal(_date.getDate());
|
var date = _date.getDate();
|
||||||
|
return String(date) + ordinal(date);
|
||||||
},
|
},
|
||||||
'P': function () {
|
'P': function () {
|
||||||
return _date.getHours() < 12 ? _locale.am : _locale.pm;
|
return _date.getHours() < 12 ? _locale.am : _locale.pm;
|
||||||
|
|
@ -255,7 +256,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mask[c] ? mask[c]() : c;
|
return mask[c]();
|
||||||
}
|
}
|
||||||
|
|
||||||
function quacksLikeDate(x) {
|
function quacksLikeDate(x) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue