Change Blog Date Format

What does this code do?

This code snippet will allow you to change the format of your blog dates from MM/DD/YY to DD/MM/YY.

 

Squarespace 7.0

Javascript

Copy and paste this code into Settings > Advanced > Code Injection > Header

Note: If you already have this line of code in the Header, skip this step.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Copy and paste this code into Settings > Advanced > Code Injection > Footer

<script>
$(document).ready(function() {
  $('time.Blog-meta-item--date').each(function(){
    let dateParts = this.innerText.split(" ");
    let day = dateParts[1].split(",");
    let date = day[0] + " " + dateParts[0] + ", " + dateParts[2];
    console.log(date);
    this.innerText = date;
  });
});
</script>
 

Squarespace 7.1

You do not need code to change the format in Squarespace 7.1. Instead you need to change the Language.

Go to Settings > Language and Region. Then change the Language to English (United Kingdom).

 
Screen Shot 2021-02-23 at 10.26.15 AM.png
 
 

How To Use It

  1. For Squarespace 7.0, copy and paste the code as indicated above.

  2. For Squarespace 7.1, change the Language to English (United Kingdom).

Rebecca Grace

Rebecca Grace is a Squarespace CSS Expert and Website Designer.

https://rebeccagracedesigns.com
Previous
Previous

Animate the Announcement Bar

Next
Next

Add a Link to Gallery Captions