public static function getSeparatedNumericDateTimeInterval($intStartDate = null, $intEndDate = null, $intStartTime = null, $intEndTime = null, $strIntervalDelimiter = ' – ', $strDelimiter = ', ')
{
$strStartDate = \Contao\Date::parse(\Contao\Date::getNumericDateFormat(), $intStartDate);
$strEndDate = \Contao\Date::parse(\Contao\Date::getNumericDateFormat(), $intEndDate);
$strStartTime = \Contao\Date::parse(\Contao\Date::getNumericTimeFormat(), $intStartTime);
$strEndTime = \Contao\Date::parse(\Contao\Date::getNumericTimeFormat(), $intEndTime);
$strResult = $strStartDate;
if ($intEndDate > 0 && $intEndDate > $intStartDate && $strStartDate != $strEndDate) {
$strResult .= $strIntervalDelimiter . $strEndDate;
}
if ($intStartTime > 0) {
if ($intEndTime > $intStartTime && $strStartTime != $strEndTime) {
$strResult .= $strDelimiter . $strStartTime . $strIntervalDelimiter . $strEndTime;
} else {
$strResult .= $strDelimiter . $strStartTime;
}
}
return $strResult;
}