From 0687f4202a7da6c7592983e25afa8185b8af4256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20P=C3=A4=C3=A4kk=C3=B6nen?= Date: Tue, 31 Dec 2013 13:03:34 +0200 Subject: [PATCH] Trigger changedatetime on blur if validate-on-blur is enabled --- jquery.datetimepicker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 67424d2..fdb1c38 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -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;