Skip to content
Snippets Groups Projects
Commit 76eecdb6 authored by llaffont's avatar llaffont
Browse files

Rendu des dates d'événement dans le calendrier: si la date de début est

la même que la fin mais que l'heure diffère, affiche "Le tel jour" au
lieu "Du ... au ..."
parent f83c91e3
Branches
Tags
No related merge requests found
......@@ -24,12 +24,12 @@ class ZendAfi_View_Helper_TagArticleEvent extends Zend_View_Helper_HtmlElement {
* @return string
*/
public function tagArticleEvent($article) {
if (!$time_start = strtotime($article->getEventsDebut()))
if (!$time_start = strtotime(substr($article->getEventsDebut(), 0, 10)))
return '';
if (!$time_end = strtotime($article->getEventsFin()))
if (!$time_end = strtotime(substr($article->getEventsFin(), 0, 10)))
$time_end = $time_start;
$month_start = strftime('%B', $time_start);
$month_end = strftime('%B', $time_end);
if ($month_start == $month_end)
......
......@@ -63,6 +63,16 @@ class TagArticleEventTest extends ViewHelperTestCase {
}
/** @test */
function withEventDebutAndFinSameDayShouldAnswerLe05() {
$this->article
->setEventsDebut('2011-09-05 08:00')
->setEventsFin('2011-09-05 10:00');
$this->assertTagContains('Le 05 septembre 2011');
}
protected function assertTagContains($expected) {
$this->assertEquals(sprintf('<span class="calendar_event_date">%s</span>', $expected),
$this->_helper->tagArticleEvent($this->article));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment