Hi Team,
I'd like disable users seeing past dates and future dates (beyond 14 days) in the calendar given by JQuery UI Date Picker widget. If I have to use Angular and use this widget is there anyway I can get this done?
Regards,
Sandesh
Hi Team,
I'd like disable users seeing past dates and future dates (beyond 14 days) in the calendar given by JQuery UI Date Picker widget. If I have to use Angular and use this widget is there anyway I can get this done?
Regards,
Sandesh
Hello,
You can use the "config" option as shown in this example - https://plnkr.co/edit/jzftHCElLDr5ZDuxFUia?p=preview.
{ "name": "date", "type": "datepicker", "inputType": "date", "title": "Your favorite date:", "dateFormat": "mm/dd/yy", "isRequired": true, "config": { "minDate": -20, "maxDate": "+1M +10D" } }
jQuery date picker documentation is here - http://jqueryui.com/datepicker/#min-max
Thanks, Serge
SurveyJS Team
Hi Serge,
Sure, thanks again. This is helpful.
Regards,
Sandesh
Hi Serge,
It was a great help, I was also looking for this configuration.
However, is there any way we can set the default value for the field to be set to current date. I know using jQuuery Datepicker we can achieve that using the following, but wonder how can I configure that in the SurveyJS widget.
$('#txtDate').datepicker().datepicker('setDate', 'today');
Thanks,
Rajesh
Hello Rajesh,
You should assign current date initially not to the control but to the survey model, as discussed in this thread - https://github.com/surveyjs/widgets/issues/70
This can be done also via the
data
property of the survey (https://surveyjs.io/Examples/Library/?id=survey-data&platform=Vue&theme=default)..)Thanks, Serge
SurveyJS Team