Merge pull request #15 from bob-frost/master

'allowBlank' option
This commit is contained in:
Valeriy 2013-12-13 11:57:24 -08:00
commit bf8b1f5ec3

View File

@ -199,6 +199,7 @@
scrollInput:true,
mask:false,
validateOnBlur:true,
allowBlank:false,
yearStart:1950,
yearEnd:2050,
style:'',
@ -417,8 +418,12 @@
input
.off('blur.xdsoft')
.on('blur.xdsoft', function(){
if( !Date.parseDate( $(this).val(), options.format ) )
if( options.allowBlank && !$.trim($(this).val()).length ){
return true;
}
else if( !Date.parseDate( $(this).val(), options.format ) ){
$(this).val((new Date()).dateFormat( options.format ));
}
});
}
options.dayOfWeekStartPrev = (options.dayOfWeekStart==0)?6:options.dayOfWeekStart-1;