Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Datetime picker

Bhushan Nagaraj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 1, 2013

How to create a datetime picker on velocity vm file? I am trying the below code but it doesn't work.

$webResourceManager.requireResource("jira.webresources:calendar")
    $webResourceManager.requireResource("jira.webresources:calendar-en")
<fieldset>
   <div class="field-group">
     <input class="text medium-field datepicker-input" id="startDate" name="startDate" type="text" required #if($startDate)value=$startDate#end/>
     <a href="#" id="startDate-trigger" title="$i18n.getText('date.picker.select.date')">
                            <span class="aui-icon icon-date">$i18n.getText('date.picker.select.date')</span></a>

    #datePopup("startDate" "startDate-trigger" $dateTimeFormat $dateFormat $timeFormat $dateTimePicker $currentMillis $currentCalendar)
   </div>
</fielddet>

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2013

It is something which I always look up while developing plugins. I have captured it here now: http://www.j-tricks.com/1/post/2013/11/date-datetime-and-user-picker-fields.html

Tested in JIRA6. Hope it works for you ;)

1 vote
Nadir MEZIANI
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2013
Hi,
Try this script:
<input id="dStart" name="dStart" type="text" class="text medium-field" /> <script language="javascript" type="text/javascript"> Calendar.setup({ firstDay : 1, inputField : 'dStart', button : 'dStart_trigger', align : 'Br', singleClick : true, showsTime : false, useISO8601WeekNumbers : false, ifFormat :'%Y-%m-%d' //'%d/%m/%Y' }); </script>

TAGS
AUG Leaders

Atlassian Community Events