Marathia’s Stacks

stacks for the rest of us

stacks for the rest of us

Stacks Image 91285

This stack is
discontinued
and will no longer be updated.

OK

Discontinued
Stacks Image 91039

LastPublished Stack

display the last published date in any format or language

As long as I remember, you can insert the date the page was last published with RapidWeaver’s %last_published% snippet. Although back in 2011 RealMac announced it was no longer supported, it still works. The date shown by this snippet will be localised, based on your system preferences for dates (mm/dd/yy or dd/mm/yy). Here’s an example of the output:
21/10/2020
That's it. But what if you prefer something like December 21, 2018 at 13:34?

Here’s where the LastPublished Stack comes in. This simple to use stack will display the last published date, but the many options of the stack make it possible to display the date in any format (7/6/2017, 17‑06‑07, 7 juni 2017, Sunday, June 6, 2017 etc.). You can even add the time and some text before and after the date to make full sentences.

The date can be fully localised and styled using the options of the stack. A time (in the formats hh:mm or hh:mm:ss) can be added after the date as well.

Demo
Here’s an example of the LastPublished Stack with its default settings:
Last published:
Below is another example, using just the month, the day of the month (with leading zero) and the last two digits of the year:
Names of the month are replaced with numbers (01…12) to show the month as digits.
Below is another example, using just the day of the week and some text before and after the date:
This page was last published on a rainy
Another example, localised (Dutch), with time and fully styled (see also fig. 1):
Deze pagina is voor het laatst gepubliceerd op
Need help using it on a non-stacks page? Here’s a tutorial.

NB
The stack will use the date and time as set by the server the page resides on.
By default, the date text will inherit the styling of the area it is displayed in as defined by the theme. Use the option of this stack to overrule this styling.
For a date with digits only (like 03/04/17), replace the names of the months with 1-12 or 01-12.
In Edit mode, this stack cannot show the actual date, but at least tries its best to show the format and styling.

Limitations
When the visitor has JavaScript disabled in his browser, the date will not show.

Background
I recently wanted to show the last published date on some pages of a site I was working on and I was not satisfied with the format of the %​last_published% snippet. I reused a script I found here for that. It worked really well, so I decided to turn it into a stack.

Support
Please use this form to report all issues, questions and comments.

This stack requires RapidWeaver (version 7 or higher) and the Stacks plugin by YourHead (version 3.5 or higher).

Yes, this website uses cookies too. Here’s the annoying but obligatory cookie warning. More info…