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 vote
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 Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

264 views 5 14
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot