Jump to content

Display day of week in event summary

Recommended Posts

I would like to display the day of the week (in all caps) in front of my dates on my event summary pages. i.e. THURSDAY, February 3, 2022

I am currently using this code on the actual events page in the Page Header Code Injection, but its not capitalizing the days or carrying over to the summary pages.

Am I putting it in the wrong place? Do I need to add additional code? and if so, where? 
I'm on brine 7.0.

<style>
  var d = new Date();
  var days = ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"];
  var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  document.getElementById("demo").innerHTML = days[d.getDay()] + " " + months[d.getMonth()] + " " + d.getDate() + " " + d.getFullYear();
</style>

 

 

Edited by tinypops
Link to comment
5 hours ago, tinypops said:

I would like to display the day of the week (in all caps) in front of my dates on my event summary pages. i.e. THURSDAY, February 3, 2022

I am currently using this code on the actual events page in the Page Header Code Injection, but its not capitalizing the days or carrying over to the summary pages.

Am I putting it in the wrong place? Do I need to add additional code? and if so, where? 
I'm on brine 7.0.

<style>
  var d = new Date();
  var days = ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"];
  var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  document.getElementById("demo").innerHTML = days[d.getDay()] + " " + months[d.getMonth()] + " " + d.getDate() + " " + d.getFullYear();
</style>

 

 

Coudl you share the site url where you use this code?

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

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.