Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to disable weekday on designer form calendar?


Level 2


I am designing an interactive form with a date/time field calendar. I need to disable the weekday date from calendar, so the user can pick the weekend dates only.

I'm currently using the following code on 'exit' event of the calendar to alert if user chose weekday.

Is there any other way to disable weekdays on 'initialize' event of date/time field?

form1.#subform[0].DateTimeField1::click - (FormCalc, client)

  var weekday = Num2Date(Date2Num($, "YYYY-MM-DD"), "EEE");
    if (weekday <> "Sat" or weekday <> "Sun" )then
        $host.messageBox("Please enter a Sunday week ending date", "Invalid Date", 0, 0);



4 Replies


Level 10

You cannot modify the calendar widget, it will always display all days of week.

But you can use scripting to select another weekday if the user selected saturday or sunday.

Put this script into the exit:Event of the date field.

It will correct the date to the previous fridy if the selected day is saturday or sunday.


Level 2

Hi radzmar,

Thanks for your quick reply. Your code is working fine but it might confuse the user.

I understand that the calendar shows all days of week, I was hoping to find a code to disable or highlight some dates.



Level 10

You possibly can create your own date picker.

But this requieres a lot of scripting and may be not working with flowable layouts.

Anyway, here's a nice sample of a selfmade calendar.



Level 2

Thanks Raszmar, I would try the date picker sample.