How to restrict the 'Date' variable in a catalog item to only allow only the current month clickable

Rakesh_Damji
Tera Contributor

We have a request to limit our users from selecting a date in a catalog request item to the current month only. For example, today is March 8, 2024, we want to ONLY allow any day in the current month (March) to be selectable. We do not want users being able to select a past date in a previous month, or a future date in the next month.

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

Prohibiting date selection by removing dates before and after the current month is not doable without DOM manipulation, which is to be avoided.

But you can easily implement a UI policy and UI policy action that clears the value if the user selects a invalid date.

No code is required (or almost none depending on your needs).

 

See example below.

ui-policy-this-month-only.png

 

ui-policy-action-this-month-only.png

View solution in original post

10 REPLIES 10

OlaN
Giga Sage
Giga Sage

Hi,

Prohibiting date selection by removing dates before and after the current month is not doable without DOM manipulation, which is to be avoided.

But you can easily implement a UI policy and UI policy action that clears the value if the user selects a invalid date.

No code is required (or almost none depending on your needs).

 

See example below.

ui-policy-this-month-only.png

 

ui-policy-action-this-month-only.png

Thank you OlaN for your helpful suggestion. We are not yet on Washington (still on Utah), but were were able to implement your suggestions and they work great. Much appreciated.

karan15
Tera Contributor

am not getting option to add "Field Message" 

I believe this option was introduced in the Washington release.

Have you upgraded yet?

Julien Sanchez
Tera Contributor

How would i do this but for specific days of the week instead of month range?