Hi Team,
We are installed JMWE and we are looking to validate time part in Date and Time custom field where users are only allowed to select time 1 hr prior to the current date and time.
Ex: if your system is 2PM, users should select time between 1-2PM.
Thank you,
Siddesh
you can create a Build-your-own Validator with a script like this:
!!issue.customfield_10201 && new Date(issue.customfield_10201) >= new Date().minusHours(1)
You'll need to replace customfield_10201 with the custom field ID of your Date/Time Picker custom field, which you'll find on the "Issue Fields" help tab of the script editor.
Hi @David Fischer , Thanks for the quick revert. Above mentioned code is not working. It creates tomorrow tickets and also 1 hr prior and later. I tried the below code also but to no luck.
!!issue.customfield_10203 && new Date(issue.customfield_10203) >= now.minusHours(1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to prevent inputting a date later than now. Try this:
!!issue.customfield_10203 && new Date(issue.customfield_10203) >= new Date().minusHours(1) && new Date(issue.customfield_10203) <= new Date()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
should only the same day be accepted as well? I.e. only a date+time within the past hour?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.