Forum Discussion
tripp-bishop
11 years agoMentor
I suspected that this was the answer but thought that I'd ask anyways just in case there was something easy I was missing.
jferrandis
9 years agoExpert
Hi
You can make a custom component to control the date format. It's some quite easy develpment.
tips: use the context to get the message
example:
<#-- check if you are in a message context --> <#if env.context.message.uniqueId??> <#-- make your query --> <#assign postTimeDataQuery = rest("2.0","/search?q=" + "SELECT post_time FROM messages WHERE id = '${env.context.message.uniqueId?c}'"?url) /> <#if postTimeDataQuery.status =="success" && postTimeDataQuery.data.size gt 0 ><#-- make sure you have some result --> <#-- now you can format date --> <#assign myFormattedDate = postTimeDataQuery.data.items[0].post_time?myCustomFormat <span class="foo"><${myFormattedDate}</span> </#if> </#if>
Here is the available builts-in for date in freemarker
Related Content
- 4 years ago
- 10 years ago