Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Library - Calendar

Hello,
I wish to limit the calendar to the year 2017. How to proceed please ?
Thank you !
Best,
SV
asked Nov 21, 2017 by s_wales (160 points)

1 Answer

0 votes
In the footer of the Calendar question, add this line between the "nextText" and "onClose" lines:

maxDate: new Date(2017, 11, 31),


Then you may want to set the custom JavaScript verification to this for good measure:

var year = Number(SSI_GetValue('[% QuestionName() %]_Year'));
if (year > 2017) {
    strErrorMessage = 'Date cannot be after 2017.';
}
answered Nov 21, 2017 by Zachary Platinum Sawtooth Software, Inc. (75,775 points)
Thanks Zach !
...