We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New extension: EEvent Helper

Development and Programming

Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

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).

Download it on GitHub.

       
JT Thompson's avatar
JT Thompson
745 posts
16 years ago
JT Thompson's avatar JT Thompson

hmmm. this could be very usefull for one of my clients. he has a mixed martial arts website that posts news, interviews etc. they also do special posts for events. this could come in really handy.

going to check it out!

thanks!

       
leadsuccess's avatar
leadsuccess
408 posts
16 years ago
leadsuccess's avatar leadsuccess

This sounds like something I have been looking to do for EEons! Seriously I cannot wait to try this on 2 sites right away. Thanks!!!

       
Milan Topalov's avatar
Milan Topalov
128 posts
16 years ago
Milan Topalov's avatar Milan Topalov

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).

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

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).

       
Milan Topalov's avatar
Milan Topalov
128 posts
16 years ago
Milan Topalov's avatar Milan Topalov

I didn’t realize event end date has to be set in a custom field.

Thanks! Nice extension 😊

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
16 years ago
Sean C. Smith's avatar Sean C. Smith

Will be starting a site with an events calendar shortly and will definitely be using this - thanks.

       
angstmann's avatar
angstmann
225 posts
16 years ago
angstmann's avatar angstmann

I had loads of trouble with dates and events on my last big EE site, and you’re right, explaining it all to clients can be time consuming, tricky and not very elegant. I look forward to trying this out some time in the future.

       
moogaloo's avatar
moogaloo
200 posts
16 years ago
moogaloo's avatar moogaloo

awesome - thanks for this!

       
NKT com's avatar
NKT com
124 posts
16 years ago
NKT com's avatar NKT com

Perfect! Just what i was after!

       
NKT com's avatar
NKT com
124 posts
16 years ago
NKT com's avatar NKT com

This really is awesome. It was very lucky i decided to check the forum today.

Feature Request Can we also force the “fixed” or “localized” setting and remove it from the clients display.

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

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.

       
NKT com's avatar
NKT com
124 posts
16 years ago
NKT com's avatar NKT com

Great thanks for the update.

I get the following error in preferences pane for the extension though…

Notice: Uninitialized string offset: 0 in /home/test/public_html/admin/extensions/ext.eevent_helper.php on line 150

EDIT: Seems to have gone after saving settings

       
timkelty's avatar
timkelty
177 posts
16 years ago
timkelty's avatar timkelty

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?

       
Derek Hogue's avatar
Derek Hogue
317 posts
16 years ago
Derek Hogue's avatar Derek Hogue

Tim - the reason I used 23:59:59 for the expiry time is that generally my clients want event listings to stick around for the whole day, even if they’re technically over before midnight.

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.