问题
How to change default datepicker template to appear as Month-Year view only .
below is the template file for detault date picker custom field:
##disable_html_escaping() TODO REENABLE
$!{auiparams.put("controlHeaderClass", "aui-field-datepicker")}
#customControlHeader ($action $customField.id $customField.name $fieldLayoutItem.required $displayParameters $auiparams)
## Show the use checkbox field to use the current date/time when configuring the field in the admin section.
#if ($displayParameters.defaultScreen)
<input class="text medium-field datepicker-input" id="$customField.id" name="$customField.id" type="text" value="$!value" />
<a href="#" id="${customField.id}-trigger" title="$i18n.getText('date.picker.select.date')">
<span class="aui-icon icon-date">$i18n.getText('date.picker.select.date')</span>
</a>
#datePopup(${customField.id} "${customField.id}-trigger" $dateTimeFormat $dateFormat $timeFormat $dateTimePicker $currentMillis $currentCalendar)
<div class="checkbox field-default">
#if($dateTimePicker)
#set ($labelText = $i18n.getText('date.picker.config.default.datetime'))
#else
#set ($labelText = $i18n.getText('date.picker.config.default.date'))
#end
<input#if ($customField.customFieldType.isUseNow($config)) checked="checked"#end class="checkbox" id="useCurrentDate" name="useCurrentDate" type="checkbox" value="true" />
<label for="useCurrentDate">${labelText}</label>
</div>
#else
<input class="text medium-field datepicker-input" id="$customField.id" name="$customField.id" type="text" value="$!value" />
<a href="#" id="${customField.id}-trigger" title="$i18n.getText('date.picker.select.date')">
<span class="aui-icon icon-date">$i18n.getText('date.picker.select.date')</span>
</a>
#datePopup(${customField.id} "${customField.id}-trigger" $dateTimeFormat $dateFormat $timeFormat $dateTimePicker $currentMillis $currentCalendar)
#end
#customControlFooter ($action $customField.id $fieldLayoutItem.fieldDescription $displayParameters $auiparams)
$!{auiparams.clear()}
I need to create cascade month-calendar picker custom field which can show only Month-Year instead of date.
EXAMPLE: Issue Edit screen:
<CALENDAR CONTROL> <CALENDAR CONTROL> <CALENDAR CONTROL>
field1 <text>
field2 <text>
field3 <text>
when we select calander value then appears as below:
APR-2013 APR-2014 APR-2015
so, if some how we could update existing date picker cusotm field to show as "month-year" view then i could create a "AbstractCustomFieldType" custom field and use it.
NOTE: I need this field to save along with the other field in issue edit screen.
Thank You
来源:https://stackoverflow.com/questions/17270650/how-to-change-custom-field-date-picker-to-appear-as-month-year-picker