Limit day of the week selected on Date Field

I would like to add some date fields to my Plumsail form and limit the days of the week available for selection.

Hello @cortese98,

You can disable certain weekdays in the calendar using widgetOptions property of the Date field.
Please find more information in the documentation here.

fd.field('Date').widgetOptions = {

    disableDates: ["we", "th", "mon"],
}

Where do I put the code in for these options? I entered it in the JS panel but it is not working.

Hello @cortese98,

You need to add the code to JavaScrip Editor >> Current Form tab.
image

The code should be added under spRendered event like this:

fd.spRendered(function() {
    fd.field('Date').widgetOptions = {
        disableDates: ["we", "th", "mon"],
    }
});

Also, please make sure that you are using the internal name of the field in the code. You can find the internal name of the field in the desktop designer. Add the field to the form, click on it, and in the left panel got to SharePoint Field >> Name.

image

I added this to a plumsail form and it not working, I can still select Wends

image

image

I got it working with
fd.rendered(function() {
fd.field('Monday').widgetOptions = {
disableDates: ["wednesday", "thursday"],
};
});

1 Like