Forum Discussion

Tyler's avatar
8 years ago

Change Date Format on message-list Component

Hi all,

 

I'm trying to change the date format on the post listing on the forum-level page. Is there a nice way to change 03-24-2015 to March 24, 2015 without getting hacky with javascript?


Screenshot 2017-08-02 12.07.39.pngScreenshot 2017-08-02 12.06.31.png
  • Hi Tyler  Try this one

    <#assign getDate = rest("2.0","search?q=" + "select post_time from messages limit 1"?url).data.items![] />
    <#list getDate as dt>
    ${dt.post_time?datetime?string}
    ${dt.post_time?date?string("MMM d, YY")} </#list>

    Here is the setting path    Admin > System > Date & Time
    Some free marker date manipulation functions are here as well.


  • Hi Tyler,

     

    I don't think so we have any admin setting/Lithium OOB component to change the date format as per your mentioned requirement.  You may need to use freemarker/javascript for your use case.

     

    Give kudos if you find my posts helpful or mark as solution if it answers your query.

    Thanks,
    Srujana Satya