How do you use jira calendar setup in the plugin for date picker?

I use following code to setup Calendar in my jira plugin:

firstDay : 0,
inputField : 'releasedate',
button : 'releasedate-trigger',
align : 'Br',
singleClick : true,
useISO8601WeekNumbers : false,
ifFormat : '%m/%d/%Y',
daFormat : '%m/%d/%Y'

The field is defined as following:

<div class="field-group aui-field-datepicker">
<label for="releasedate">Release Date<span class="aui-icon icon-required"></span>
<span class="content"> required</span></label> <input
id="releasedate" class="text medium-field" type="text"
name="releasedate"/> <a id="releasedate-trigger"
title="Select a date" href="#"> <span
class="aui-icon icon-date">Select a date</span> </a>

My question is:

1. Is this correct way to use the date picker?

2. Is there a way I can use the date formats used everywhere else in JIRA? I don't want the plugin to stick out with its different date format. I can probably change my format to match default JIRA format, but if user decides to change the default format - my format will look different.


2 answers

1 accepted

0 votes
Accepted answer
Timothy Chin Community Champion May 18, 2013

If you want to use the system format, then you will have to call the format and parse it to the Javascript.

Thanks, how do you go about doing it? I was hoping for some javascript setup method that can be called to setup calendar date format..

Timothy Chin Community Champion May 18, 2013


Thanks, do you know where these keys are documented?

Timothy Chin Community Champion May 18, 2013

No. Google them or open up the source code.

Thanks for the help. I was hoping for something simple in Javascript using AUI or just AJS.setupCalendar(..) kind of thing. But it is what it is - Appreciate you taking time to answer this.

I also found in the forum this example.

The answer in this example:

public String getJiraDateFormat(ApplicationProperties applicationProperties) {
String format = applicationProperties.getDefaultBackedString(APKeys.JIRA_LF_DATE_DMY);
return format;

The property that I needed was

"" , that is APKeys.JIRA_LF_DATE_DMY

Hi Abhijit,

Why you don't use this ?

&lt;input class="text medium-field" id="preprodDate" name="preprodDate" type="text" value="#esc($!duedate)" /&gt;
    	&lt;a href="#" id="preprodDate-trigger" title="$i18n.getText('')"&gt;
        	&lt;span class="aui-icon icon-date"&gt;$i18n.getText('')&lt;/span&gt;
    	#datePopup("preprodDate" "preprodDate-trigger" $dateTimeFormat $dateFormat $timeFormat true $currentMillis $currentCalendar)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Agile

What is Scrum? A good, bad, and ugly answer.

In a world of dark-scrum, faux-scrum, and scrum-butt, the question still remains: What is scrum and how do you do it “right?” That’s the question we set out to answer. I'm Max, I've been teaching c...

73 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you