1
0
Fork 0
forked from 0x2620/oxjs

rather use ''.slice than ''.substr

This commit is contained in:
rolux 2012-05-24 11:47:33 +02:00
commit 1608664bb6
20 changed files with 69 additions and 71 deletions

View file

@ -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')
};