Skip to content
Snippets Groups Projects
Commit b983009b authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#78773_bug_affichage_calendrier_sur_periode_octobre' into 'hotline'

hotline #78773 fix calendar days incrementation

See merge request !2792
parents f132fa4f e65dd2cd
Branches
Tags
4 merge requests!2806Master,!2805Hotline,!2799Master,!2792hotline #78773 fix calendar days incrementation
Pipeline #4836 passed with stage
in 49 minutes and 16 seconds
- ticket #78773 : Calendrier : correction de l'affichage des jours du mois de mars et du mois d'octobre dû aux changements d'heures effectués respectivement le 25 et le 28.
\ No newline at end of file
<?php
<?php
echo $this->calendarContent($this->param);
?>
......@@ -282,7 +282,7 @@ class ZendAfi_View_Helper_Calendar_Table extends ZendAfi_View_Helper_BaseHelper
protected function getCalendarTableDays($articles) {
$first_month_day = mktime(0, 0, 0, $this->month, 1, $this->year);
$first_month_day = mktime(10, 0, 0, $this->month, 1, $this->year);
$offset = (7 - (1 % 7 - date('w', $first_month_day))) % 7;
$current_day = $first_month_day - 3600 * 24 * $offset;
$row_number = ceil((date('t', $first_month_day) + $offset) / 7);
......
......@@ -1046,4 +1046,27 @@ class CmsControllerCalendarActionWithOutDateTest extends AbstractControllerTestC
public function gatArticleByPreferencesShouldBeCallWithEventDAteAfter() {
$this->assertXPathContentContains('//div', 'Kitchen', $this->_response->getBody());
}
}
class CmsControllerCalendarDuplicateDayDueToHourChangeTest extends CmsControllerCalendarActionTestCase {
public function setUp() {
parent::setUp();
ZendAfi_View_Helper_CalendarContent::setTimeSource(new TimeSourceForTest('2018-09-03 00:00:00'));
$this->dispatch('/cms/calendar/date/2018-10/render/ajax');
}
public function tearDown() {
ZendAfi_View_Helper_CalendarContent::setTimeSource(null);
parent::tearDown();
}
/** @test */
function day28ShouldBeDisplayOnlyOnce() {
$this->assertXPathCount('//td/span[contains(text(), "28")]', 1);
}
}
\ No newline at end of file
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