Trigger changedatetime on blur if validate-on-blur is enabled

This commit is contained in:
Teemu Pääkkönen 2013-12-31 13:03:34 +02:00
parent 6e6e3f564a
commit 0687f4202a

View File

@ -428,11 +428,13 @@
.off('blur.xdsoft')
.on('blur.xdsoft', function() {
if( options.allowBlank && !$.trim($(this).val()).length ) {
return true;
$(this).val(null);
}
else if( !Date.parseDate( $(this).val(), options.format ) ) {
$(this).val((new Date()).dateFormat( options.format ));
}
datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
datetimepicker.trigger('changedatetime.xdsoft');
});
}
options.dayOfWeekStartPrev = (options.dayOfWeekStart==0)?6:options.dayOfWeekStart-1;