PHP is so well made that I am wondering if there is a function for what I need.
For events that last more than one day, the human way to format it is complex.
Exemples...
Event one: from 2015-04-20 to 2015-04-22 could be formatted for humans like this: April 20-22 2015
Event two: from 2015-04-01 to 2015-05-31 Humans -> April-May 2015
Event three: from 2015-04-30 to 2015-05-02 Humans -> April 30 to May 2 2015
In short, never repeat what doesn't needs to be repeated. Link with "-" as much as possible.
It will have to be localized and the format could change depending of the local. For exemple, US folks like MonthName DayNumber Year but French like DayNumber MonthName Year.
I was planning on programming such formatting, but I was wondering if it already existed :)
This works...
But I do think in some situations, even human beings need to be told that April-May will begin the 1st and end the 31st.
Just in case someone else stumbles upon this: I've written a small library that tries to solve this problem in a way that also works with internationalization:
https://github.com/flack/ranger
It should provide a reasonable default for ltr languages (and rtl support shouldn't be too hard to add)