Jump to content

Squarespace 7.1: Change blog post dates to show age - "3 days ago" and so on

Go to solution Solved by paul2009,

Recommended Posts

  • Solution

There isn't a built-in feature that does this. If you are familiar with JavaScript (or you hire a developer who is) then a solution could be written to do this in JavaScript (assuming the site is on a Business Plan or above).

In summary, you'll first need to use JS to extract the date of each post and calculate the number of seconds between then and now. If it is less than 60 seconds you'd substitute "X seconds ago", if it is less than 3600 you substitute "X minutes ago" and so on.

The script should be added to the Code Injection Footer so that it runs after the blog post(s) have loaded, allowing the dates to be modified.

Edited by paul2009

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment

The code would be written to look for every blog post date on the page and modify it as described. 

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.