Jump to content

Two dates showing on blog post summary page

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hello, I've got an issue where two dates are showing on my blog summary page, below the picture and above the title (image below).

While I've read the article on how to change blog dates and been deep in the settings, I still cannot for the life of me figure out how to stop this happening.

I'd ideally like to have one date there, just not two, does anyone know how to fix this? My Squarespace version is 7.1 (if displaying just one date is not possible, how do I remove it from displaying a date at all?).

Thanks team!

 

 2009411626_BlogDateHeaderIssue.png.69fc28a70fa3a9d93438645234efb44d.png

Posted (edited)
On 5/7/2022 at 11:21 PM, tuanphan said:
On 5/7/2022 at 11:21 PM, tuanphan said:

Hi,

Have you solved it yet? If no, can you share link to a blog post?

Hi,

Have you solved it yet? If no, can you share link to a blog post?

Hi, not solved yet! Thanks for checking in, I still can’t find a setting for this anywhere…

 

 

 

Edited by MKT
  • Solution
Posted
On 5/9/2022 at 5:23 PM, MKT said:

Hi, not solved yet! Thanks for checking in, I still can’t find a setting for this anywhere…

The blog is:

https://marikaknows.com/

 

 

Edit Blog Section >> Disable Primary or Secondary Metadata

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!)

Posted

 

That was it! Got it! Thank you, I'm not sure how it turned on since it never used to be on, but I was able to turn it back off for secondary only!

  • 1 year later...
Posted
On 11/2/2023 at 2:05 PM, catalienne said:

Hi @tuanphan I am getting 2 different date formats for 2 different blog posts on the blog posts list, I refreshed the date to display but then it goes back to incorrect format. The one #NSBCS.002 from today 2nd november 2023 displays as 11/02/2023 on the blog list but correctly on the blog post. the #NSBCS.001 is fine as 26/10/2023. Very strange!

I can see the pub date is showing incorrectly for #NSBCS.002 but how to change that?

https://www.nsbcyber.com/signals

I need both posts in the blog list to look like dd/mm/yyyy not mm/dd/yyyy.

I did insert this code in the code section but this fixed the blog post dates maybe it's causing issues for the date on blog post list now.

<!-- 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 = "dd/mm/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>

 

Please help thanks

I don't see date now. Do you still need help?

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!)

Posted
On 11/2/2023 at 2:05 PM, catalienne said:

Hi @tuanphan I am getting 2 different date formats for 2 different blog posts on the blog posts list, I refreshed the date to display but then it goes back to incorrect format. The one #NSBCS.002 from today 2nd november 2023 displays as 11/02/2023 on the blog list but correctly on the blog post. the #NSBCS.001 is fine as 26/10/2023. Very strange!

I can see the pub date is showing incorrectly for #NSBCS.002 but how to change that?

https://www.nsbcyber.com/signals

I need both posts in the blog list to look like dd/mm/yyyy not mm/dd/yyyy.

I did insert this code in the code section but this fixed the blog post dates maybe it's causing issues for the date on blog post list now.

<!-- 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 = "dd/mm/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>

 

Please help thanks

The code has been updated since the last time you use it, could you give this a try?
https://forum.squarespace.com/topic/207841-freeshare-date-display-format-options-on-all-pages/?do=findComment&comment=630658

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> 🤖 Ask me anything

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.