X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/40bcf2582cfacf12cbb31a37e546574d311bee69..9d0f67d98d3fcb021e1098128f2e42a6bf411bfb:/Repository/SessionRepository.php diff --git a/Repository/SessionRepository.php b/Repository/SessionRepository.php index 2a11c59..afe7335 100644 --- a/Repository/SessionRepository.php +++ b/Repository/SessionRepository.php @@ -156,10 +156,14 @@ class SessionRepository extends \Doctrine\ORM\EntityRepository { 'sessions' => [] ]; - //Append month for first day of month + //Detect month change if ($month != $date->format('m')) { $month = $date->format('m'); - $calendar[$Ymd]['title'] .= '/'.$month; + //Append month for first day of month + //XXX: except if today to avoid double add + if ($date->format('U') != strtotime('today')) { + $calendar[$Ymd]['title'] .= '/'.$month; + } } //Deal with today if ($date->format('U') == ($today = strtotime('today'))) { @@ -316,10 +320,14 @@ class SessionRepository extends \Doctrine\ORM\EntityRepository { 'sessions' => [] ]; - //Append month for first day of month + //Detect month change if ($month != $date->format('m')) { $month = $date->format('m'); - $calendar[$Ymd]['title'] .= '/'.$month; + //Append month for first day of month + //XXX: except if today to avoid double add + if ($date->format('U') != strtotime('today')) { + $calendar[$Ymd]['title'] .= '/'.$month; + } } //Deal with today if ($date->format('U') == ($today = strtotime('today'))) {