Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Filter date field on Maintain Item

cgedney
Giga Guru

I have been asked:

Can you disallow the calendar selection of the day if it is less than the required for 5 business days – it currently
allows you to select the date but then errors on submit.

 

Basically, I have a request form that has a date field. They do not want the user to select a date prior to 5 days from now. I created a catalog client script and I check to see if the date they select is before 5 days from now. If so, then it shows the error message and clears the date field. They want the date field to be pre-filtered with dates from 5 days from now on.

 

Is that possible?

 

Thank you, Charles

2 REPLIES 2

maroon_byte
Mega Sage

Nope.

I dont know jQuery but have a look at this: https://davidwalsh.name/jquery-datepicker-disable-days

Option to consider: If the user selects a date within next 5 days, don't clear the date but set it to the next available day.

But do you need to consider 5 days? or 5 business days? If later, then business calendar with holidays need to be considered in the calculation of the next available business day.

I hadn't thought of that, but not sure how I can inject JQuery into the calendar field. Maybe building a custom control or something like that.