I am looking for a way to create a field that supports only Time - NOT DateTime. I want to be able to enter a time in H:mm format. I know about exiting the global context for jira.date.time.picker.java.format, but I have other fields that need this. I can't use Number field, as I can't enter colons. I don't want a text field, as this needs to be a valid time format.
I have tried to add the following in the description of a custom field:
<script type="text/javascript">
{document.getElementById("customfield_11700").format = "H:mm";}
</script>
but this does not seem to work.
When trying to manually edit, I get:
customfield_11700: Invalid date format. Please enter the date in the format "dd/MMM/yy h:mm a".
I think the best way forward would be to somehow override the validation, but I can't seem to figure out how.
I would prefer to do this with javascript injection instead of a plug-in, as I am not authorized to acquire any more plugins (and we do not have script-runner).