Start Calendar View On Specific Date/Month

Pie Calendar doesn't include a built-in option to start the calendar view on a specific date. It will always show today's date/week/month when loaded.

If you need the calendar to show some specific date when it is first loaded, you can use a simple JavaScript snippet on the page where the calendar is displayed:

document.addEventListener('DOMContentLoaded', () => {

This code will wait until the document is loaded, then find the calendar on the page and change its date to whatever is defined inside the gotoDate() function. In the example, it will show the month of July in 2024 (2024-07-01).

This snippet can be added via an HTML block in Gutenberg or via a third-party code snippet management plugin of your choice.

🗳️ Candidate Feature

Is this something you need for your Pie Calendar use case? Would you like to see a native option for setting the default month and/or showing the first event by default?

Let us know at!

Not sure where to add the code? Watch this video!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.