LiQL view_friendly_date of post_time
Dear Community,
we are using a LiQL query like that:
<#assign mostviewedMessages = restadmin("2.0", "/search?q=" + ("SELECT * FROM messages where conversation.style='blog' AND depth=0 ORDER BY metrics.views DESC limit 5")?url).data.items![] />
Is it possible to get the post_time of the messages also in view_friendly format like “2 weeks ago”? How?
${mostviewedMessage.post_time } shows “Jul 8, 2016 12:34:13 PM”
${mostviewedMessage.post_time@view_friendly_date} is not working
Thank you, best
Clemens
Hi clemensw
increase the days in below option:
Admin > System > Date and Time > Number of days to use relative dates
Ex:1500Code:
<#assign query="SELECT * FROM messages where conversation.style='blog' AND depth=0 ORDER BY metrics.views DESC limit 5"/>
<#assign mostviewedMessages = restadmin("2.0", "/search?q=" +query?url).data.items/>
<#list mostviewedMessages as mostviewedMessage>
${mostviewedMessage.post_time_friendly}<br>
</#list>