diff --git a/src/index.js b/src/index.js index cd75a16..1da3d0c 100644 --- a/src/index.js +++ b/src/index.js @@ -31,11 +31,11 @@ _adapters._date.override({ parse: function(value, format) { const options = this.options; - if (value === null || typeof value === 'undefined') { + const type = typeof value; + if (value === null || type === 'undefined') { return null; } - const type = typeof value; if (type === 'number') { value = this._create(value); } else if (type === 'string') {