ExpressionEngine 2024 Quarter 1 Review Quarter 1 Review
Hey all - I wrote this extension today after being frustrated yet again at the tedious instructions I aways have to give my clients when posting to an “events” weblog in EE. Telling them to manually set the Expiration Date so events disappear when they should; having them set a separate end date for multi-day events, which is located in a totally different spot than the entry date in the Date tab … not so slick.
This extension has solved these problems for me completely, and I was so stoked with the results that I implemented it on two older sites right after I finished it for the current site I’m working on. Hopefully someone else can find it as useful.
Once activiated, when entries are published in your specified “events” weblogs, their Expiration Date will be automatically set to 23:59:59 on the day of the event. Or, if you choose a custom date field to serve as an End Date indicator, their Expiration Date will be automatically set to 23:59:59 on the End Date (if it’s not empty).
You can also specify a custom Start Date field to use instead of the Entry Date calendar from the Date tab. Once you specify this field, you can automatically set the Entry Date to match the custom Start Date field, eliminating the need for the Date tab altogether. This way, you and your clients can use friendlier custom date fields for both start and end dates, while always keeping the entry’s Entry Date and Expiration Date set properly for use in exp:weblog:entries tag parameters.
Lastly, you can force the Start Date and End Date fields to have their time set to 00:00:00 upon publishing.
Note that only fields of the built-in ExpressionEngine “Date” fieldtype can be selected as Start Date or End Date fields.
EEvent Helper has been tested on ExpressionEngine 1.6.8.
UPDATE: - version 1.0.1 includes the option to hide the date localization toggle on the custom date fields, and choose what the default should be.
UPDATE: - version 1.0.2 updates the “force midnight” setting to also remove the “time” portion of the date fields in your Events weblog, so the calendar picker inserts dates in the format of YYYY-MM-DD. The time will still be automatically set to midnight when published.
UPDATE: - version 1.1 supports settings for multiple events weblogs. EEvent Helper also now requires CP jQuery loading jQuery 1.3+.
UPDATE: - version 1.2 is more MSM-aware (previous versions worked with the MSM, but version 1.2 is optimized for it).
How do you deal with multiday events?
I like the way the Expiry date defaults to the Entry date, but this prevents me from creating multiday events.
It would be great if it were to default to Entry date, unless user specifies a different Expiry date.
PS I’m using Entry and Expiry dates to set the beginning and the end of the event (including multiday ones).
Milan - that’s what the End Date field is for. You create a custom field of the Date field type, and enter your event end date there. EEvent Helper will set the Expiration Date to the end of that day if it has a date entered. Otherwise, it will set it to the end of the Entry Date (or custom Start Date field if specified).
Glad this sounds useful for you folks.
I just pushed version 1.0.1 to GitHub, which includes the option to hide the date localization toggle on the custom date fields, and choose what the default should be. I usually install the Low CP extension, so this fell under my radar during development.
So using this, you can never have an event with a specific end date AND time? For instance, an event that specifically goes from 1pm - 3pm on a given day.
It seems like the expiration date/time should be set to 11:59 if its not set with the custom field, but if it is, then the time is matched.
Or am I confused?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.