Constraining the Event Calendar

Hi,
Is there any way to do the following two things in the event calendar? I’m using Wappler 5.8.2 on PHP server.

  1. NAVIGATING
    Let’s say that I need to ensure that the user cannot move to a month outside of the current year. In an ideal case, I should be able to control the buttons (see picture below) used to move the calendar month back and forth.

In order to do that, I probably need to be able to pick up the event of the user clicking those buttons or be able to disable them upon condition (e.g., disable the left button when I the calendar shows January and the right button when the calendar shows December. Unfortunately, I don’t know how to do that, or if it is even possible.

  1. CREATING AN EVENT
    In addition to the above, I need to ensure that the event can only be created within a given period. For example, the allowed dates should only fall within 20 days before today and 10 days after today. This valid period obviously moves as the date changes, so tomorrow’s valid period will start and end a day later than today’s.

I did not see a way to disable dates in the calendar, so I thought of a workaround but I’m still wondering if there is a better way to do it. My workaround is like this:

  • Ensure the calendar is set to not allow overlapping events.
  • Create a dynamic event that would go from Jan 1 to the day before the first available date (today - 20)
  • Create a dynamic event that would go from the last available date (today + 20) to Dec 31

Any help on these two points will be really appreciated!!
Many thanks in advance,

Alex