Fix exception when mask isn't set or is false.

Added an additional check to ensure options.mask is a string as it is set to false when not using masks.
Fixes #414
This commit is contained in:
Steven 2016-03-24 19:56:14 +13:00
parent 467388d233
commit ef522190fb

View File

@ -1164,7 +1164,7 @@
input
.off('blur.xdsoft')
.on('blur.xdsoft', function () {
if (options.allowBlank && (!$.trim($(this).val()).length || $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_'))) {
if (options.allowBlank && (!$.trim($(this).val()).length || (typeof options.mask == "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) {
$(this).val(null);
datetimepicker.data('xdsoft_datetime').empty();
} else if (!dateHelper.parseDate($(this).val(), options.format)) {