Add year to Skye Template Blog

You can use this code to Code Injection > Footer to add Year to Skye template blog post.

<script src="https://stevenlevithan.com/assets/misc/date.format.js"></script>
<script>
    (function(){
        document.addEventListener('DOMContentLoaded', function() {
            const pubdates = document.querySelectorAll("time[datetime]:not([class*=event-time]), time[pubdate], time.blog-meta-item--date, time.dt-published");
            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]);
                }
                // Định dạng ngày theo Month Day, Year
                pubDate.innerHTML = d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }); 
            });
        });
    })();
</script>