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>