BobRockefeller Posted March 22, 2023 Posted March 22, 2023 Can the year be added to the display of the published date? How Beyondspace 1
tuanphan Posted March 24, 2023 Posted March 24, 2023 Hi, For blog posts, event or? Can you share link to a page? We can check easier If you use SS 7.1, you can also read this guide first Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
BobRockefeller Posted March 24, 2023 Author Posted March 24, 2023 (edited) I would have expected perhaps a global setting for how dates are displayed so that they are consistent across the site. But reading the referenced post, I see that is not the way. My use, right now, is for blog listings and blog posts. https://lion-terrier-9jys.squarespace.com/photography/moving-pictures Password: catdog I am running Version 7.1, but hope not to have to pay for a business account to get blog dates. Edited March 24, 2023 by BobRockefeller Beyondspace 1
Beyondspace Posted May 5, 2023 Posted May 5, 2023 On 3/25/2023 at 6:10 AM, BobRockefeller said: I would have expected perhaps a global setting for how dates are displayed so that they are consistent across the site. But reading the referenced post, I see that is not the way. My use, right now, is for blog listings and blog posts. https://lion-terrier-9jys.squarespace.com/photography/moving-pictures Password: catdog I am running Version 7.1, but hope not to have to pay for a business account to get blog dates. Your site is deleted? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
BobRockefeller Posted May 7, 2023 Author Posted May 7, 2023 On 5/5/2023 at 11:38 AM, Beyondspace said: Your site is deleted? Rolled over to www.bobrockefeller.com.
Solution Beyondspace Posted May 8, 2023 Solution Posted May 8, 2023 (edited) 19 hours ago, BobRockefeller said: Rolled over to www.bobrockefeller.com. Since you site is US based, I chose the date format "mm-dd-yyyy" Check the snippet on snapshot mode of your site here The snippet is originated from https://forum.squarespace.com/topic/207841-freeshare-date-display-format-options-on-all-pages/#comment-506718 <!-- Fix inconsistent blog date format on Squarespace 7.1 template --> <!-- Squarespace Forum Update 06-11-2021 --> <script src="https://stevenlevithan.com/assets/misc/date.format.js"></script> <script> (function(){ document.addEventListener('DOMContentLoaded', function() { const dateformat = "mm-dd-yyyy"; const pubdates = document.querySelectorAll("time[datetime]:not([class*=event-time]), time[pubdate], time.blog-meta-item--date"); pubdates.forEach(pubDate => { let d = new Date(pubDate.getAttribute("datetime") || pubDate.innerText); if (pubDate.classList.contains('blog-meta-item--date') ) { d = new Date(document.querySelector('[itemprop="datePublished"]').getAttribute('content').split("T")[0]); } pubDate.innerHTML = d.format(dateformat); }); }); })(); </script> Edited May 8, 2023 by Beyondspace CesO and BobRockefeller 1 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
Beyondspace Posted May 16, 2023 Posted May 16, 2023 @BobRockefeller There is update to the script where you can choose different date format on the live editor More info BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment