ScreenSteps

Customizing the date format for "Last Updated" in the 2015 (Old) Template

Updated on

This article will show you how you can customize the date format used to display the Last Updated date of an article. This can be done from the site text translation area.

Navigate to the Settings Text > Sidebar translation section and edit the Last Updated field. By default it will have the following value:

<h3>Last Updated</h3><p>{{ lesson.posted_at | format_date }}</p>
Click to copy

You can customize the format of the date by passing some parameters to format_date. When no parameters are passed to format_date then the date is displayed as Month Day, Year using the formatting string %b %d, %Y.  If you want to display the Day Month, Year you could use %d %b, %Y as the formatting string.

Here is what the Last Updated field would look like when passing in a custom formatting string:

<h3>Last Updated</h3><p>{{ lesson.posted_at | format_date(date, "%d %b, %Y") }}</p>
Click to copy

There is a visual tool for creating formatting strings available at http://strftime.net. Use the tool to create a formatting string that displays the date in the format you would like and then use the example above to create your own Last Updated field value.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Previous Article Using jQuery to reorder the sidebar in the 2015 (Old) Template
Next Article Adding Google Translator to your site in the 2015 (Old) Template
Still Need Help? Contact Us