Question T1109
Visible to All Users

Jquery UI Date Picker Widget - Restrict Past and Future dates beyond certain days

created 7 years ago

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

Show previous comments (1)
SD SD
Sandesh DSouza 7 years ago

    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.

      JavaScript
      $('#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