File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,22 @@ function init(Survey) {
1515 var $el = $ ( el ) . is ( ".widget-datepicker" ) ? $ ( el ) : $ ( el ) . find ( ".widget-datepicker" ) ;
1616 var pickerWidget = $el . datepicker ( {
1717 dateFormat : question . dateFormat ,
18+ option : {
19+ minDate : null ,
20+ maxDate : null
21+ } ,
1822 onSelect : function ( dateText ) {
1923 question . value = dateText ;
2024 }
2125 } ) ;
2226 question . valueChangedCallback = function ( ) {
23- pickerWidget . datepicker ( 'setDate' , new Date ( question . value ) ) ;
27+ if ( question . value ) {
28+ pickerWidget . datepicker ( 'setDate' , new Date ( question . value ) ) ;
29+ } else {
30+ pickerWidget . datepicker ( 'setDate' , null ) ;
31+ }
2432 }
2533 question . valueChangedCallback ( ) ;
26- if ( ! question . value ) question . value = new Date ( ) ;
2734 } ,
2835 willUnmount : function ( question , el ) {
2936 var $el = $ ( el ) . is ( ".widget-datepicker" ) ? $ ( el ) : $ ( el ) . find ( ".widget-datepicker" ) ;
You can’t perform that action at this time.
0 commit comments