Limit date calendar entry to anything post 2-3 months from today

MBarrott
Mega Sage

I'm wanting to give users the ability to ensure the optimal date that they are wanting a demand to be completed. 

 

The restriction is that they should only be able to select a day which is 2-3 months away from the current date (grace period not currently set in stone).

 

What is the optimal way to achieve this? 

2 REPLIES 2

AshishKM
Kilo Patron
Kilo Patron

Hi @MBarrott , 

After date field change, check this 2-3 month logic via onChange script.

 

check below thread for some date compare logic

https://www.servicenow.com/community/developer-forum/calculate-the-amount-of-days-between-two-dates/...

 

https://www.servicenow.com/community/incident-management-forum/difference-between-two-dates/m-p/2565...

 

https://www.servicenow.com/community/itsm-forum/how-to-get-difference-between-two-dates-start-date-a...

 

-Thanks,
AshishKMishra


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Hi @AshishKM

 

I'm not sure those links are applicable. I would like the make a grace period inaccessible for the end-user to select rather than compare to what they've selected.