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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

$datePickerFormatter.withStyle(String).format($value) Not Working Edited

I posted a question HERE about using a Script Field for a date type. My main question was answered, but a new problem came to light.

I'm using a Script Field with a custom template and a Date Time Range Picker searcher. The custom template is as follows:

$datePickerFormatter.withStyle("MMM d, YYYY").format($value)

 I'm trying to get the date output formatted like "Aug 20, 2018" using the above format string, but it's not working. In fact, no matter what string I pass to withStyle, the output is always in the same format. E.g:

$datePickerFormatter.withStyle('').format($value)
$datePickerFormatter.withStyle('MMM d, YYYY').format($value)
$datePickerFormatter.withStyle('mm:ss').format($value)
$datePickerFormatter.withStyle('dmy').format($value)

 All of these format strings output the same format: 28/Aug/18 12:19 PM.

Why? And how do I get my desired format?

Jira 7.9.2

1 answer

There is nothing in the detail of these links that explains that

Like minzel likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Asked in Jira Service Desk

Calling all Insight users, we need your help!

Hello Insight users,  As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...

134 views 1 0
View question

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you