eo_format_datetime_range
since 3.0.0
eo_format_datetime_range( $datetime1, $datetime2, $format, $seperator = ' – ', $is_rtl = null )
Formats two DateTime objects according to a specified format by "spliting"
The function uses a single formatting string to generate a range string like
16th-17th February by intelligtently inserting a seperator where the DateTimes
differ according to the specified format.
If the formatted dates are identical then no seperator is added the behaviour is
is the same as eo_format_datetime().
Parameters
\dateTime
|
$datetime1 |
The first datetime object
|
\dateTime
|
$datetime2 |
The second datetime object
|
string
|
$format |
How to format the date range, see http://php.net/manual/en/function.date.php
|
string
|
$seperator = ' – ' |
A string used to seperate differing parts of the formatted DateTimes
|
bool
|
$is_rtl = null |
Whether the formatted date should be written right-to-left. Defaults to is_rtl().
|
Return value
string|\dateTime
|
The formatted date range
|
Changelog
Resources