Is there a way to restrict the time in date and time variable type in catalog item

Negha1
Tera Contributor

I have requirement where i need to restrict the time in date and time variable type in catalog item

eg:

If you available between 11 am to 4 PM in a day , then while raising the REQ, for selecting date and time, user should select any time between 11 to 4PM , how to restrict this in the form level for end user.

2 ACCEPTED SOLUTIONS

@Negha1 

so it should be based on timezone of that logged in user?

if yes then use this onChange client script

This checks the time is between 11am to 4pm based on logged in user timezone

Output: I selected GMT and then Los angeles time and it gave me the error

time between 11am to 4pm logged in user timezone.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

@Negha1 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Negha1 

which timezone? logged in users can be from different timezone

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Negha1
Tera Contributor

UTC

@Negha1 

how are you checking the availability and whose availability?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Negha1
Tera Contributor

The end user who is going to enter the details-Time should be their current system timezone will be taken, but that should is restricted to 11am to 4 PM to enter the time.