javascript - How can I limit the dates that can be selected in this Date Picker in Qualtrics? -
i need limit dates can selected 2017!? appreciated!
<link href="https://ajax.googleapis.com/ajax/libs/yui/2.9.0/build/calendar /assets/skins/sam/calendar.css" rel="stylesheet" type="text/css"/><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/yui/2.9.0 /build/yahoo-dom-event/yahoo-dom-event.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/yui/2.9.0 /build/calendar/calendar-min.js"></script> <script>qualtrics.surveyengine.addonload(function(){var qid =this.questionid; var calid = qid +'_cal';var y =qbuilder('div'); $(y).setstyle({clear:'both'});var d =qbuilder('div',{classname:'yui-skin- sam'},[qbuilder('div',{id:calid}), y ]);var c =this.questioncontainer; c = $(c).down('.questiontext'); c.appendchild(d);var cal1 =new yahoo.widget.calendar(calid); cal1.render();var input = $('qr~'+ qid); $(input).setstyle({margintop:'20px',width:'150px'});var p =$(input).up(); var x =qbuilder('div'); $(x).setstyle({clear:'both'}); p.insert(x,{position:'before'}); cal1.selectevent.subscribe(function(e,dates){var date = dates[0] [0];if(date[1]<10) date[1]='0'+ date[1];if(date[2]<10) date[2]='0'+ date[2]; input.value = date[1]+'-'+date[2]+'-'+date[0];})});</script>`
var cal1 = new yahoo.widget.calendar("cal1","cal1container", { pagedate: "1/5/2017", mindate: "1/5/2017", maxdate: "1/15/2017" } );
Comments
Post a Comment