Jump to content

Groeipiraat

Circle Member
  • Posts

    11
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Groeipiraat got a reaction from creedon in Change header button language Squarespace 7.1   
    Thank you very much @creedon, it works perfectly now! 👏
  2. Like
    Groeipiraat reacted to creedon in Change header button language Squarespace 7.1   
    @Groeipiraat
    You need to follow the instructions from the February 2 post. The code from the April 30 post is a special case.
  3. Like
    Groeipiraat got a reaction from Beyondspace in Date display format options   
    @bangank36 I tried this for events, but this does not work.  Is there a way of making this code also work for Event dates for Squarespace 7.1 events (e.g. dd-mm-jjjj)?
    And maybe even for Event times, to convert 12hr into 24hr system (e.g. 23:59:59) instead of the AM/PM Squarespace is using now?
    Would be much appreciated if you could provide such code (since I don't know how to code).
     
    Thanks in advance!
    ^Steven
     
  4. Like
    Groeipiraat got a reaction from Beyondspace in Date display format options   
    Thank you sooo much for this code! It worked perfectly to transform the US date and time to EU format.
    I really appreciate your help! Have an amazing day and me the Gods be with you on your journey, my friend!
     
    🙏
  5. Like
    Groeipiraat got a reaction from Beyondspace in Date display format options   
    You are absolutely AMAZING! 
  6. Love
    Groeipiraat reacted to Beyondspace in Date display format options   
    Try
    <!-- Fix inconsistent blog + event date format on Squarespace 7.1 template --> <!-- Squarespace Forum 03-08-2021 --> <script src="https://stevenlevithan.com/assets/misc/date.format.js"></script> <script> document.addEventListener('DOMContentLoaded', function() { var dateformat = "mm-dd-yyyy"; var timeformat = "H:MM"; var pubdate = document.querySelectorAll("time[datetime]:not([class*=event-time]), time[pubdate], time.blog-meta-item--date"); for (var i = 0; i < pubdate.length; i++) { var d = new Date(pubdate[i].getAttribute("datetime") || pubdate[i].innerText); if ( pubdate[i].classList.contains('blog-meta-item--date') ) { d = new Date(document.querySelector('[itemprop="datePublished"]').getAttribute("content").split("T")[0]).getAttribute("content"); } pubdate[i].innerHTML = d.format(dateformat); } var eventTime = document.querySelectorAll("time[datetime][class*=event-time]"); for (var i = 0; i < eventTime.length; i++) { console.log(eventTime[i].getAttribute("datetime") + " " + eventTime[i].innerText); var d = new Date(eventTime[i].getAttribute("datetime") + " " + eventTime[i].innerText); eventTime[i].innerHTML = d.format(timeformat); } var eventTimeSummary = document.querySelectorAll(".summary-metadata-item--event-time"); for (var i = 0; i < eventTimeSummary.length; i++) { var _24hrs = eventTimeSummary[i].querySelector(".event-time-24hr"); var _12hrs = eventTimeSummary[i].querySelector(".event-time-12hr"); _12hrs.innerHTML = _24hrs.innerHTML; } }); </script>
×
×
  • 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.