The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jake Jollimore
August 29, 2018

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Mike L
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 2, 2019

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

Like minzel likes this
TAGS
AUG Leaders

Atlassian Community Events