Make Past and non available dates invisible/gray-out in Calendar.

Yash47
Tera Contributor

I have a requirement in my project to Create a Cat Item in which I have to create date field which having the dates available only I have to make them visible to end user to select the slot.

And the dates which are available will be based on some condition from backend.

 

At the end , I have to make slot picked calendar which will have only available slot dates.

 

Similarly like this below picture, this was taken on 30th July,2015, here we are not able to select past dates and able to select only dates after 3 days from now, so it is showing default date as 2nd Aug,2015.



find_real_file.png

 

Can anyone please tell me how to achieve this in ServiceNow.

5 REPLIES 5

suvro
Mega Sage
Mega Sage

I think there is no feature as such currently, but you can put validations like below in a client script

var start = new Date(g_form.getValue('<yourDateField>'));
var today = new Date();
if (start < today)

alert('Start date must be in the future.'); 
}

 

Community Alums
Not applicable

Community Alums
Not applicable

Hello Yash,

Did you get chance to look into solution provided by me. Please let me know if you need any help.

 

Regards,

Akshay

Hi Akshay,


Sorry,
I didn't got the solution from your thread provided.

 

Thanks,
Yash.