– use the strtotime() and date_i18n() functions on start and end dates in order to display them exactly as we want.

The role of the plugin

Until now, all the things we described could be used as an event management system that works completely without a plugin. :)

So the role of the plugin is only to improve the usability for the end user.

The plugin:
– will offer a clean interface for setting start and end date.
– will enable us to restrict dates only to specific post types, if we want. This could be defined in some admin panel, or more simply in the functions.php file.
– will prevent mistakes, like wrongly formated dates.

The interface

WordPress already offers an interface for setting date/time information: we see it in the publication date field of each post. It’s actually a dropdown menu and simple input fields: not a revolution in terms of interface design, but it’s perfectly usable.

In order to keep the interface consistent, the most logical thing is to use exactly the same design for our date system (rather than adding some flashy jQuery date picker, like most plugins tend to do).

Here is a mockup of how the date management interface should look like:

1) Initial state.

2) Entering a start date (without time information).

3) The start date has been saved.

4) Entering an end date.

5) The end date has been saved.

And here you can see how this would integrate with the post edition interface:

What else?

Are there other features that the plugin should be able to handle?
Yes, a few:

- Optional times: the plugin should allow that the user leaves the date field empty. The strtotime() function will render an empty time field into 00:00. I would tend to solve this in the most simple way, by testing for a 00:00 time stamp in the theme, and not displaying the time if that is the case.

- Localization: the plugin must be localized, through the standard .po / .mo files, so that it can be adapted for other languages. There won’t be much translation work, as the interface is really minimal.

- Repeating events: sooner or later the need for repeating events will appear. Technically, this shouldn’t be too difficult: we need just another custom field, that holds a date/time string, or an array of date/time strings. We also need to add to the mockup a button that allows to add a repeat.

Here is how it could look like:

And here we are editing the Repeat date:

Finally, here is how it would look like with several repeats:

Wanna help?

Are you interested in this idea? Are you able to help me developing this plugin? Then please get in touch – immediately! :-)

Update: the plugin is already there, has been successfully tested, and will be publicly available soon, thanks to the great work of Vlad and Dan at Dream Production.