Forums

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

Confluence user macro fromNow() function

Daz Daz January 10, 2019

Hi guys,

I'm trying to beautify dates or simplify or whatever you call it. Instead of showing absolute datetime like 2019-01-01T08:00:00, it would be better if I show 5 days ago or Yesterday or 5 minutes ago and the likes. 

I am using Scriptrunner for JIRA and it is using groovy scripts. For .net I can use moment.js but not too sure for groovy script. If possible I do not want to do it the hard way and have hundred lines of code/logic just to translate absolute datetime to relative datetime. 

Any kind soul knows how to do this?

1 answer

0 votes
Davin Studer
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.
January 11, 2019

Did you mean Scriptrunner for Confluence? Is this a question about Confluence or Jira? Also, user macros use velocity, not Groovy, so I'm unsure how you are trying to use ScriptRunner with a user macro if this is indeed for Confluence. What date specifically do you want to show as relative?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events