how to create custom date field in the format of MM-YY?

assaf lev February 17, 2016

Hi Guys,

 

I have a business requirement to be able to input a date field in the format of MMM-YY only.

examples:

Aug 16 or Nov 15

 

Can anyone advise on how to do that?

Thanks

3 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2016

Ok, there's a few more options here...

Script runner won't do it, unless what you want to do is put a normal date field on edit screens and then write a scripted field that displays the MMM-YY format you want on view (and search)

Another option, if you don't have too huge a range of dates to worry about might be a cascading select field with yyyy for the first option and then the months in the second option

Possibly the easiest option - have two fields, one with a list of years, and a second with the 12 months in it.  No coding or fuss required, but they will be independent of each other (again though, a similar trick to the first one - write a scripted field that combines them for display and search)

2 votes
Boris Georgiev _Appfire_
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.
February 18, 2016

You can use

  1.  A scripted field (ScriptRunner or JJUpin) 
  2. Change the date format globally https://www.kerstner.at/en/2013/01/customizing-date-format-in-jir/
  3. Use add-on like JIRA Misc Custom fields https://innovalog.atlassian.net/wiki/display/JMCF/JIRA+Misc+Custom+Fields#JIRAMiscCustomFields-calculateddatefield It supports custom date format
  4. Other solution - search for another solution in Google smile

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2016

On 4 - google is most likely to give you "write your own add-on to do it..."

assaf lev February 18, 2016

@Boris Georgiev [Botron],

first of all thanks for your help.

  1. we do own scriptrunner - but unfortunately I am no scripting expert, still having difficulties working with it, I will really appreciate if you can help me find a more specific answer to using scriptrunner as a solution.
  2. we are not interested in changing the date format globally..
  3. the add-on supports calculated date fields, which are uneditable, this is not a proper solution for us.
  4. as @Nic Brough [Adaptavist] said smile

 

Thanks guys!

 

Boris Georgiev _Appfire_
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.
February 18, 2016

Somehow I missed the fact that you want to actually edit the field and not just display it...

0 votes
assaf lev February 20, 2016

@Nic Brough [Adaptavist]

Thanks!

I'll use the second option you offered.

Suggest an answer

Log in or Sign up to answer