Most of the time dealing with date and time is a pain for software projects, for plugin developers JIRA is not different. JIRA has a build-in date time picker JS component, it is a lot easier to use this component than developing your own or throwing a 3rd party implementation. At leas you will not introduce new js, css to be transferred and users will be familiar with user interface because JIRA itself uses that component in any date field.
Here is the component we are talking about:
First of all there are multiple ways of injecting date and time formats into velocity template, below is only one of these.
It is not enough to specify just parameters in the velocity template, we have to provide values of these variables. Easiest way to do it using JIRA’s build in VelocityParamsFactory class. You can inject this class to your own class and just use its getDefaultvelocityParams method. You have to provide JiraAuthenticationContext because some of the injected values may be determined differently according to logged in user.