in Ox.parseDate, only remove first element of values array if there was a match
This commit is contained in:
parent
4625b4ac36
commit
92bfb38caf
1 changed files with 2 additions and 1 deletions
|
@ -279,8 +279,9 @@ Ox.parseDate = function(string, utc) {
|
||||||
var date,
|
var date,
|
||||||
defaults = [, 1, 1, 0, 0, 0, 0],
|
defaults = [, 1, 1, 0, 0, 0, 0],
|
||||||
values = /(-?\d+)-?(\d+)?-?(\d+)? ?(\d+)?:?(\d+)?:?(\d+)?\.?(\d+)?/
|
values = /(-?\d+)-?(\d+)?-?(\d+)? ?(\d+)?:?(\d+)?:?(\d+)?\.?(\d+)?/
|
||||||
.exec(string).slice(1);
|
.exec(string);
|
||||||
if (values) {
|
if (values) {
|
||||||
|
values.shift();
|
||||||
date = new Date();
|
date = new Date();
|
||||||
values = values.map(function(v, i) {
|
values = values.map(function(v, i) {
|
||||||
return v ? (i == 6 ? Ox.pad(v, 3, '0') : v) : defaults[i];
|
return v ? (i == 6 ? Ox.pad(v, 3, '0') : v) : defaults[i];
|
||||||
|
|
Loading…
Reference in a new issue