# Add year to Skye Template Blog

**URL:** <https://community.elfsight.com/t/add-year-to-skye-template-blog/85508>\
**Category:** Platform Tips\
**Tags:** squarespace\
**Created:** [November 27, 2024, 2:39am UTC](https://community.elfsight.com/t/add-year-to-skye-template-blog/85508 "2024-11-27T02:39:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuanphan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/tuanphan/32/3165_2.png) [@tuanphan](https://community.elfsight.com/u/tuanphan)\
**Post date:** [November 27, 2024, 2:39am UTC](https://community.elfsight.com/t/add-year-to-skye-template-blog/85508/1 "2024-11-27T02:39:57Z")

</div>

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

```auto
<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>

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/f/a/faa2eb7530a34da61f8bdac00aaba85e000becc8.jpeg)
