mirror of
https://github.com/samsonjs/strftime.git
synced 2026-03-25 09:05:48 +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));
|
||||
}
|
||||
|
||||
return format.replace(/%([-_0]?)(.)/g, processing);
|
||||
return format.replace(/%([-_0]?)([AaBbCDdeFHhIjkLlMmnoPpRrSsTtUuvWwYyZz])/g, processing);
|
||||
}
|
||||
|
||||
var mask = {
|
||||
|
|
@ -160,7 +160,8 @@
|
|||
return '\n';
|
||||
},
|
||||
'o': function () {
|
||||
return String(_date.getDate()) + ordinal(_date.getDate());
|
||||
var date = _date.getDate();
|
||||
return String(date) + ordinal(date);
|
||||
},
|
||||
'P': function () {
|
||||
return _date.getHours() < 12 ? _locale.am : _locale.pm;
|
||||
|
|
@ -255,7 +256,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
return mask[c] ? mask[c]() : c;
|
||||
return mask[c]();
|
||||
}
|
||||
|
||||
function quacksLikeDate(x) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue