Customize Event List date format

I have searched the archived forums and Slack but haven’t found a solution in regards to customizing the date format on the Event List block and Event Detail block. Currently, the date format is 31 Aug, 2021 but I would like it to appear as 31 August, 2021.

To change the date format on a Page List Block is easy but appears to be more tricky on the Calendar Event blocks?


<?=$service->formatCustom('d', $occurrence->getStart())?>

Replacing the d with the date format you want

Thank you for your help but unfortunately, it threw up some errors.
This is the code line that I hope just needs editing using a templated version of the Calendar Event view.php file.

<?= $formatter->getOccurrenceDateString($occurrence) ?>

@TMDesigns 's suggestion is correct. You can see it’s done that way in the core block.

What errors did you get?

Hi Myq,
thank you for your help. You are right in regards it working on the event list block but I was also referring to the ‘Calendar Event’ block.

The error I am getting is “Call to a member function formatCustom() on null”

I am not sure whether some additional code is required before to declare what ‘formatCustom’ is?

@studio108 please see my response here: Display Calendar Event Info - #8 by Myq