Event Calendar - weekly view

81 posts by 2 authors in: Forums > CMS Builder
Last Post: 20 hours ago   (RSS)

By Djulia - October 28 - edited: October 30

Yes, you are right. It's an error in the array(). It was for my tests.

It should be replaced

'start_date' => '2024-11-02 14:00:00',
'end_date' => '2024-11-02 00:00:00',

With:

'start_date' => '2024-11-02 14:00:00',
'end_date' => '2024-11-02 17:00:00',

OK, I've updated and it works but it still doesn't work fully in production mode. 

I think I'm going to remove some dates and test one at a time.

By Djulia - October 28 - edited: October 29

I added this condition to correct events where the end date is less than or equal to the start date by assigning them a minimum duration of one hour, thereby ensuring that all events have a valid duration.

// Condition to check if end_date needs to be corrected
if ($eventEnd <= $eventStart) {
    // Add 1 hour to the start date for the end date
    $eventEnd = $eventStart->modify('+1 hour');
}

I also added the schema that I use.

Thanks!

Attachments:

calendar.zip 10K

By Djulia - October 29 - edited: October 29

Hi MercerDesign,

If you're interested, this version adds a color parameter to events and improves the year view (12 months).

It is necessary to add a "color" field to your events table.

Don't forget to back up your table.

Thanks, Djulia

Thank you. I've updated so will see what happens when I put in my events. We won't need the year view but it's very useful to have. Thank you again for all your help.

By MercerDesign - October 29 - edited: October 29

As soon as I change the calendar to production mode the week view doesn't work even though there are events showing in the month view. The previous week view works but not the next week.

If the event for the week is in the next month it doesn't show.

in production mode? so in the CMS?

By Djulia - October 29 - edited: October 29

'example'

If you export your calendar and send me your schema file (events.ini.php), I can try to see what’s going on.

That works, but here is my schema so you can see what is going on when it's in the CMS

Attachments:

events.ini.php 5K