How to customize date picker.

Le Son
Tera Contributor

After when I create field with type is date time.

I want customize this field. I don't want the user to be able to select on Saturdays and Sundays. It will readonly

How to customize date picker?

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Le Son ,

 

I don't think that is doable. But what you can do is , write an onChange script on that field & validate if the date selected is on SAT or SUN. if Yes then you can clear the value from that field & display a field msg as error or an alert stating . Sat & Sun cannot be selected.

 

Thanks,

Danish

 

View solution in original post

6 REPLIES 6

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Le Son ,

 

I don't think that is doable. But what you can do is , write an onChange script on that field & validate if the date selected is on SAT or SUN. if Yes then you can clear the value from that field & display a field msg as error or an alert stating . Sat & Sun cannot be selected.

 

Thanks,

Danish

 

Yes, I think this is also good idea. So I will performd by way

Hi @Le Son ,

 

If my response helped kindly mark it as Helpful & Accepted , so that other users can benefit from it.

 

Thanks,

Danish

 

newhand
Mega Sage

@Le Son 
As @Danish Bhairag2  posted,we can only use onChange script or Br to check the date which user selected。

We can't limit anything when pickking the date ,although it's a normal function on other systems.

I'm not sure if serviceNow will update this widget...

 

Please mark my answer as correct and helpful based on Impact.