How to change date display format in Dawn theme?

This is on the Home / Navigation page. Rather than Month / Day to the left of each post title (e.g. “APR 22”) I want it to be month / year (e.g. “APR 2024”). What’s the simplest way to do this? Thanks!

The date formatting comes from the theme files, specifically this part here:

To change that to the format you want, you could implement the following:

<div class="feed-calendar">
    <div class="feed-calendar-month">
        {{date published_at format="MMM"}}
    </div>
    <div class="feed-calendar-year">
        {{date published_at format="YYYY"}}
    </div>
</div>

For reference, here is the documentation on the date helper: Ghost Handlebars Theme Helpers: date

Keep in mind that you’d need to build the theme before re-uploading it. You can do that by running yarn zip / npm run zip (you’d need Node.js installed for that).

Thank you! But I should have clarified that this is for a Ghost Pro site, not a self-hosted one. Can I implement this with code injection?

Phew, tricky. From the top of my head, I’d say you’d have to query the content API to fetch the dates and then format them there.

I see this as the perfect use case of not using code injection, to be honest, because it will get quite messy and just a workaround for something that Ghost (and the theme helpers) can do natively – though I understand the restrictions in your hosting plan.

Maybe somebody else has some ideas :thinking: