Question T13558
Visible to All Users

Unable to use minValueExpression and maxValuExpression on datepicker

created 2 years ago (modified 2 years ago)

Hi Team,

I have a requirement wherein I have to choose a date between a specified range.
minDate: today()
maxDate: 31/12/currentYear

Below is the code snippet which works on plunker but not on my code repo:

JSON
{ "type": "text", "name": "daysLeftToExpire", "defaultValueExpression": "diffDays(getTodayDate(\"MM/dd/YYYY\"),'12/31/'+{getCurrentYear})" }, { "type": "datepicker", "name": "eff_change_date", "title": "Eff. Change Date", "isRequired": true, "inputType": "date", "dateFormat": "dd/mm/yy", "minValueExpression": "today()", "maxValueExpression": "today({daysLeftToExpire})", "requiredErrorText": "This field is required", "placeHolder": "Enter effective date", "width": "40%" },
Show previous comments (1)
AS AS
Akanksha Shetiye 2 years ago

    Yes, those are the custom functions… The above code snippet works properly/as expected on plunker but not on my project repo.

    AS AS
    Akanksha Shetiye 2 years ago

      Does it requires any specific version to support the above feature.
      I'm using is -
      Angular 14
      jquery 3.6.0

        Hello,
        Please make sure you are using the same SurveyJS versions in your project and in plunker.

        Thank you,
        Andrew
        SurveyJS Team