Our powerful JS Calendar component


Post by LPERUM-C@txdot.gov »

Hi,
We have requirement to disable the past dates in the calendar widget. we tried 'beforeeventeditshow' as mentioned in the link -viewtopic.php?f=44&t=17470, but we are not getting the below values from event editor.

 
           const { widgetMap } = editor;
            widgetMap.startDateField.disabled = true;
            widgetMap.startTimeField.disabled = true;
            widgetMap.endDateField.disabled = true;
            widgetMap.endTimeField.disabled = true;
            

any suggestions on how to disable the past dates?


Post by mats »

I added this to the basic demo which disabled the input fields, can you please explain a bit more clearly what is not working? + provide a full runnable test case so we can inspect?

,
    listeners : {
        beforeEventEditShow({ editor }) {
            const { widgetMap } = editor;
            widgetMap.startDateField.disabled = true;
            widgetMap.startTimeField.disabled = true;
            widgetMap.endDateField.disabled = true;
            widgetMap.endTimeField.disabled = true;
        }
    }

Post Reply