Blocking out dates on date picker from entries submitted

What I’m trying to do is use this snippet I found online inside a html field and allow the script to dynamically insert the calculation of start date and end date to mark out the dates so no one can select them again. I tried no duplicates, but it only allows for the individual date to not be selected and doesn’t mark it out. Is there a simple solution here to dynamically populate this area with my submit start and end dates entries?

gform.addFilter( ‘gform_datepicker_options_pre_init’, function( optionsObj, formId, fieldId ) {
if ( formId == 5 && fieldId == 1 ) {
var disabledDays = [‘GET MY DYNAMIC ENTRY RANGE FROM START DATE AND END DATE’];
optionsObj.beforeShowDay = function(date) {
var checkdate = jQuery.datepicker.formatDate(‘mm/dd/yy’, date);
return [disabledDays.indexOf(checkdate) == -1];
};
}
return optionsObj;
});

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.