How to grey out/disable calendar dates outside a given range on xlsx

Hi everyone,

I am trying to configure a date field so that users can only choose dates within a 90-day period.

So far, I have been able to implement the restriction using the constraint column in XLSForm. However, the calendar still displays the other dates normally.

What I would like is for dates outside the permitted 90-day range to appear greyed out/disabled, so users can immediately tell which dates are selectable.

Is there a way to customize the calendar appearance to achieve this, rather than relying only on the constraint validation?

Any suggestions or examples would be appreciated. Thank you!

What’s happening instead?

So far, I have been able to implement the restriction using the constraint column in XLSForm. However, the calendar still displays the other dates normally.

What I would like is for dates outside the permitted 90-day range to appear greyed out/disabled, so users can immediately tell which dates are selectable.

Is there a way to customize the calendar appearance to achieve this, rather than relying only on the constraint validation?

Any suggestions or examples would be appreciated. Thank you!

I believe, unfortunately, that is not available. Good idea though, maybe do you want to add to suggestion box?

Hi @estherwashu thanks for your question.
Not out of the box. Webforms date picker (a bootstrap-datepicker widget) doesn’t read your XLSForm constraint, so invalid days stay clickable. The constraint is only evaluated after the user picks a date, and then the field shows your constraint_message.

Thanks, I will do that :slightly_smiling_face:

Okay, yeah, I noticed that’s how it behaves..I will make a suggestion to have an option to affect the appearance of the date so that beyond a specified range the dates are grayed out. Thanks!