JoelleM Posted April 26, 2022 Share Posted April 26, 2022 (edited) 5 hours ago, creedon said: Let us know how it goes. Hi @creedon, thanks you so much for taking the time to think about this, I appreciate it. There's still one inconsistency on the blog page. I've now got dd-m-yyyy throughout (summary block, posts) but the first post on the blog page has dd-mm-yyyy and the other 3 have dd/mm/yyyy. Weird huh? Edit: I've tried updating dateformat to dd mmmm yyyy, and there's still an inconsistency going on with the blog page. Tried changing date of that post to 11 April (to see if the single digit might be the issue, the others are all 2 digit dates), and that had it change to 4 November on the blog page (11 April on summary block/blog post), so it is confused! Edited April 26, 2022 by JoelleM Added more info Link to comment
Beyondspace Posted April 26, 2022 Author Share Posted April 26, 2022 6 hours ago, JoelleM said: Hi @creedon, thanks you so much for taking the time to think about this, I appreciate it. There's still one inconsistency on the blog page. I've now got dd-m-yyyy throughout (summary block, posts) but the first post on the blog page has dd-mm-yyyy and the other 3 have dd/mm/yyyy. Weird huh? Edit: I've tried updating dateformat to dd mmmm yyyy, and there's still an inconsistency going on with the blog page. Tried changing date of that post to 11 April (to see if the single digit might be the issue, the others are all 2 digit dates), and that had it change to 4 November on the blog page (11 April on summary block/blog post), so it is confused! I can not see the custom code on the source. Have you added it to your site? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
JoelleM Posted April 26, 2022 Share Posted April 26, 2022 (edited) 4 minutes ago, bangank36 said: I can not see the custom code on the source. Have you added it to your site? I took it off as it wasn't working right. I'll add it back - used your code with dd mmmm yyyy dateformat, then tried @creedon's above, but in both cases it was not affecting all posts on the blog page. I'll pop it back on now so you can see. Edit: now done. Edited April 26, 2022 by JoelleM update Link to comment
Beyondspace Posted April 26, 2022 Author Share Posted April 26, 2022 19 hours ago, ChiroUp said: Hi there, I tried using this code on my site: https://chiroup.com It worked however it's a day off on each publication date if you look at the blog post and then on the blog home page. The dates don't match. They are off by one day. Please help. Have you figured it out? Can you share the direct link to the page that gets issue? I can not not find it BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Beyondspace Posted April 26, 2022 Author Share Posted April 26, 2022 1 minute ago, JoelleM said: I took it off as it wasn't working right. I'll add it back - used your code with dd mmmm yyyy dateformat, then tried @creedon's above, but in both cases it was not affecting all posts on the blog page. I'll pop it back on now so you can see. You can duplicate the current page and add my custom code only in this page via page setting. Then give me the link to the testing page so It won't effect to other pages BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
ChiroUp Posted April 26, 2022 Share Posted April 26, 2022 2 minutes ago, bangank36 said: Have you figured it out? Can you share the direct link to the page that gets issue? I can not not find it No I haven't figured it out. If you look at the dates on this page https://chiroup.com/blog - they don't match up when you click on the actual blog. It's one day off for every blog. (pictures attached) tonyflores 1 Link to comment
JoelleM Posted April 26, 2022 Share Posted April 26, 2022 2 minutes ago, bangank36 said: You can duplicate the current page and add my custom code only in this page via page setting. Then give me the link to the testing page so It won't effect to other pages It doesn't let me duplicate it since its a blog page maybe, only the posts? I don't mind faffing with it, it's not live yet. I've added it to code injection only on this page now instead of in site settings: https://together-learning-trust-new.squarespace.com/news-views Thanks for looking, I appreciate it. Link to comment
Beyondspace Posted April 27, 2022 Author Share Posted April 27, 2022 9 hours ago, JoelleM said: It doesn't let me duplicate it since its a blog page maybe, only the posts? I don't mind faffing with it, it's not live yet. I've added it to code injection only on this page now instead of in site settings: https://together-learning-trust-new.squarespace.com/news-views Thanks for looking, I appreciate it. I think your template and locale settings are not compatible with the snippet, do you mind if I pm you for further discussion BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
creedon Posted April 27, 2022 Share Posted April 27, 2022 16 hours ago, JoelleM said: There's still one inconsistency on the blog page. I've now got dd-m-yyyy throughout (summary block, posts) but the first post on the blog page has dd-mm-yyyy and the other 3 have dd/mm/yyyy. Did you set the monthFirst constant to false? This is what I see without any code running. Here is what I see with the code and my additions. JoelleM 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Beyondspace Posted April 27, 2022 Author Share Posted April 27, 2022 @creedon your modification will only solve an edge case and it probably won't work with a different date format, but it will work if @JoelleM checks it is okay with this. The root cause of this issue is regarding localization date format and will need more time to invest creedon and JoelleM 2 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
creedon Posted April 27, 2022 Share Posted April 27, 2022 9 minutes ago, bangank36 said: your modification will only solve an edge case and it probably won't work with a different date format Agreed. My additions were to help JolleM and anyone who might be in her exact situation. They are not meant to address all date issue problems. JoelleM 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
JoelleM Posted April 27, 2022 Share Posted April 27, 2022 (edited) In case anyone comes along with a similar weird problem to mine - with a nudge from @bangank36 as to the cause - I fixed this by switching the site language from UK English to US English, then the code worked. Thanks @bangank36 and @creedon for your help. Edited April 27, 2022 by JoelleM Steph-86, GemmsyA and Beyondspace 1 1 1 Link to comment
Steph-86 Posted June 7, 2022 Share Posted June 7, 2022 Thanks @JoelleM that worked for me, such a bizarre thing that the code now works! JoelleM 1 Link to comment
arogers Posted June 14, 2022 Share Posted June 14, 2022 I've used the code on my workplace's blog and I'm running into the same problem several other people have described. The date showing is one day off. So if the post was posted on the 13th, it will show the 12th. We are using the mm-dd-yyyy format. https://blog.1000bulbs.com/ Link to comment
g-souza Posted July 14, 2022 Share Posted July 14, 2022 Hi there! I'm facing the same problem as many others... Dates are displaying one day off. Have you guys found any solution yet? I've deleted the code for now, but I'm looking forward to adjust all dates across the site, specially for events and blog pages. Link to comment
Beyondspace Posted July 16, 2022 Author Share Posted July 16, 2022 On 7/15/2022 at 4:07 AM, g-souza said: Hi there! I'm facing the same problem as many others... Dates are displaying one day off. Have you guys found any solution yet? I've deleted the code for now, but I'm looking forward to adjust all dates across the site, specially for events and blog pages. Can you share your site? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
g-souza Posted July 21, 2022 Share Posted July 21, 2022 On 7/15/2022 at 11:03 PM, bangank36 said: Can you share your site? Hi @bangank36. Sure:https://sawfish-lute-xb5x.squarespace.com/ password: central2022 I put the code back so you can take a look. Please check the pages:https://sawfish-lute-xb5x.squarespace.com/exposicoes (events)https://sawfish-lute-xb5x.squarespace.com/noticias (blog) I'm attaching some screenshots from these pages without the code, so you can see how dates are jumping back one day. I also noticed this code is not affecting summary blocks, which I'm using in different pages across the site. Any help is much appreciated. Link to comment
Beyondspace Posted July 22, 2022 Author Share Posted July 22, 2022 11 hours ago, g-souza said: Hi @bangank36. Sure:https://sawfish-lute-xb5x.squarespace.com/ password: central2022 I put the code back so you can take a look. Please check the pages:https://sawfish-lute-xb5x.squarespace.com/exposicoes (events)https://sawfish-lute-xb5x.squarespace.com/noticias (blog) I'm attaching some screenshots from these pages without the code, so you can see how dates are jumping back one day. I also noticed this code is not affecting summary blocks, which I'm using in different pages across the site. Any help is much appreciated. I will check and reply you soon BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Creatingspaces Posted August 24, 2022 Share Posted August 24, 2022 Hey @bangank 36, I use the code above I wasn't sure if it should go in the code injection for header, footer or somewhere else. I put it in header but all my blog posts still say the date in this format: APR 15. I am trying to get the date in this format: April, 15, 2022. This is the code I put in the code injection header. Any help would be greatly appreciated. Thank you, the website URL right now is https://friendsofthechildrenofvnzla.squarespace.com/ <!-- 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 = "mmm 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> Beyondspace 1 Link to comment
paulpants Posted September 6, 2022 Share Posted September 6, 2022 (edited) Anyone solve the issue with the blog page meta date and the blog post meta dates being a day off? Running into this same issue @bangank36. Region is US New York, language set to US English. Thanks... Edited September 6, 2022 by paulpants Link to comment
Beyondspace Posted September 6, 2022 Author Share Posted September 6, 2022 1 hour ago, paulpants said: Anyone solve the issue with the blog page meta date and the blog post meta dates being a day off? Running into this same issue @bangank36. Region is US New York, language set to US English. Thanks... Can you share your site so I can take a look? paulpants 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
paulpants Posted September 7, 2022 Share Posted September 7, 2022 @bangank36 Sure thing! https://clownfish-tan-a6xl.squarespace.com/ PASS: circlE3@!P Beyondspace 1 Link to comment
PaulRVT Posted September 16, 2022 Share Posted September 16, 2022 This worked fine on our site, but we are getting the problem another user had, that there is a date difference between the listing page and the detail page: https://www.riorchestra.org/news I can turn off date on detail page, but be nice if it was correct. Link to comment
Lou_90_ Posted October 13, 2022 Share Posted October 13, 2022 Hi, I have added to code to update the date (mmmm, yyyy) and it words perfectly on individual blog pages, but not on the blog list page. Can you please help? Thanks! https://www.ivyandpiper.com.au/media Link to comment
GemmsyA Posted October 13, 2022 Share Posted October 13, 2022 On 4/27/2022 at 9:30 AM, JoelleM said: In case anyone comes along with a similar weird problem to mine - with a nudge from @bangank36 as to the cause - I fixed this by switching the site language from UK English to US English, then the code worked. Thanks @bangank36 and @creedon for your help. OMG thanks so much. This fixed it for me! JoelleM 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment