Skip to content

Commit e3ada61

Browse files
author
Łukasz Serwatka
authored
Merge pull request #705 from mnocon/fix-adminui-tests
Fix Behat DateTime tests
2 parents dfc9028 + f78f409 commit e3ada61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/Behat/PageElement/DateAndTimePopup.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function setDate(DateTime $date, string $dateFormat = self::DATETIME_FORM
4747

4848
$dateToDiff = $this->deleteDayFromDate($date);
4949
$currentDateToDiff = $this->deleteDayFromDate($currentDate);
50+
$dateToDiff->modify('+1 day');
5051
$interval = $dateToDiff->diff($currentDateToDiff);
5152
$monthsDiff = 12 * $interval->y + $interval->m;
5253

@@ -70,7 +71,7 @@ public function setDate(DateTime $date, string $dateFormat = self::DATETIME_FORM
7071

7172
public function deleteDayFromDate(DateTime $dateTime): DateTime
7273
{
73-
return DateTime::createFromFormat('Y-m', $dateTime->format('Y-m'));
74+
return DateTime::createFromFormat('!Y-m', $dateTime->format('Y-m'));
7475
}
7576

7677
public function switchToNextMonth(): void

0 commit comments

Comments
 (0)