Hi Experts!
I'm developing a plugin and I need to show last time its configuration has changed on plugin admin page.
In the servlet invoking the template:
...
context.put("lastUpdate", autoEscalateConfigDao.getRulesLastUpdate()); //java.util.Date
...
response.setContentType(CONTENT_TYPE);
renderer.render(UPLOAD_TEMPLATE, context, response.getWriter());
In velocity template:
#if ($lastUpdate)
<div class="description"><i>Last rules update: $lastUpdate</i></div>
#end
But this is showing something like "Last rules update: 2018-05-22 09:44:58.589"
I would like to show it in relative dates format (X minutes/hours/days ago, yesterday, ...). So I've tried:
$webResourceManager.requireResource("jira.webresources:jquery-livestamp")
...
#if ($lastUpdate)
<div class="description"><i>Last rules update #1: <span data-name="lastUpdate" id="updated-val" data-fieldtype="datetime"><time class="livestamp" datetime="$lastUpdate">$lastUpdate</time></span></i></div>
#endBut still the same. I've tried to surround with $datetimeformatter.format($lastUpdate), but it shows literally "$datetimeformatter.format($lastUpdate)".
I've been looking a lot of similar posts but I can't found a complete example.
I would like this date was shown in relative date format and changing when time passes, as date fields do in issue view screen.
Could you please give me some ligth about how to get this?
Thanks in advance!
________
Leirbag