Merge pull request #417 from Sibz/Sibz-patch-mask-exception

Fix exception when mask isn't set or is false.
This commit is contained in:
Valeriy 2016-03-25 00:13:35 +05:00
commit ab609606f9

View File

@ -1176,7 +1176,7 @@
input input
.off('blur.xdsoft') .off('blur.xdsoft')
.on('blur.xdsoft', function () { .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); $(this).val(null);
datetimepicker.data('xdsoft_datetime').empty(); datetimepicker.data('xdsoft_datetime').empty();
} else if (!dateHelper.parseDate($(this).val(), options.format)) { } else if (!dateHelper.parseDate($(this).val(), options.format)) {