diff --git a/build/kalendae.js b/build/kalendae.js index 3515d8b..46ac9e0 100644 --- a/build/kalendae.js +++ b/build/kalendae.js @@ -591,10 +591,14 @@ var parseDates = function (input, delimiter, format) { } var c = input.length, - i = 0; + i = 0, + m; do { - if (input[i]) output.push( moment(input[i], format).hours(12) ); + if (input[i]) { + m = moment(input[i], format).hours(12); + if (m.isValid()) output.push(m); + } } while (++i < c); return output; @@ -967,6 +971,8 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, { util.removeEvent($input, 'blur', this._events.inputBlur); util.removeEvent($input, 'keyup', this._events.inputKeyup); + + $container.remove(); } }); diff --git a/build/kalendae.standalone.js b/build/kalendae.standalone.js index 5248cd9..8ae8ade 100644 --- a/build/kalendae.standalone.js +++ b/build/kalendae.standalone.js @@ -591,10 +591,14 @@ var parseDates = function (input, delimiter, format) { } var c = input.length, - i = 0; + i = 0, + m; do { - if (input[i]) output.push( moment(input[i], format).hours(12) ); + if (input[i]) { + m = moment(input[i], format).hours(12); + if (m.isValid()) output.push(m); + } } while (++i < c); return output; @@ -967,6 +971,8 @@ Kalendae.Input.prototype = util.merge(Kalendae.prototype, { util.removeEvent($input, 'blur', this._events.inputBlur); util.removeEvent($input, 'keyup', this._events.inputKeyup); + + $container.remove(); } });