forked from 0x2620/oxjs
rather use ''.slice than ''.substr
This commit is contained in:
parent
f990f3b857
commit
1608664bb6
20 changed files with 69 additions and 71 deletions
|
|
@ -119,7 +119,7 @@ Ox.TimeInput = function(options, self) {
|
|||
function getDate() {
|
||||
return new Date('1970/01/01 ' + (
|
||||
self.options.milliseconds
|
||||
? self.options.value.substr(0, self.options.value.length - 4)
|
||||
? self.options.value.slice(0, -4)
|
||||
: self.options.value
|
||||
));
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ Ox.TimeInput = function(options, self) {
|
|||
return {
|
||||
ampm: Ox.formatDate(date, '%p'),
|
||||
hours: Ox.formatDate(date, self.options.ampm ? '%I' : '%H'),
|
||||
milliseconds: self.options.milliseconds ? self.options.value.substr(-3) : '000',
|
||||
milliseconds: self.options.milliseconds ? self.options.value.slice(-3) : '000',
|
||||
minutes: Ox.formatDate(date, '%M'),
|
||||
seconds: Ox.formatDate(date, '%S')
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue