mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
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:
parent
467388d233
commit
ef522190fb
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user