fix: read one-sided booking times as "ab" and "bis"
This commit is contained in:
1 parent
179769187b
commit
bbb0a8aaa2
4 files changed
+29
-4
No files matched your search
@@ -42,7 +42,7 @@ class SpotTest extends TestCase
|
||||
// Taken 09:00-13:00 leaves 00:00-09:00 (9h) and 13:00-24:00 (11h).
|
||||
$spot = $this->spot([$this->booking($this->someoneElse(), 540, 780)]);
|
||||
|
||||
self::assertSame('13:00–24:00', (string) $spot->suggested());
|
||||
self::assertSame('ab 13:00', (string) $spot->suggested());
|
||||
}
|
||||
|
||||
public function testTheSuggestedWindowIsAlwaysBookable(): void
|
||||
|
||||
@@ -149,6 +149,14 @@ class TimeRangeTest extends TestCase
|
||||
self::assertSame('yes', $twig->render('t', ['range' => TimeRange::wholeDay()]));
|
||||
}
|
||||
|
||||
public function testAOneSidedRangeReadsAsAbOrBis(): void
|
||||
{
|
||||
self::assertSame('bis 13:00', (string) TimeRange::fromMinutes(TimeRange::DAY_START, 13 * 60));
|
||||
self::assertSame('ab 13:00', (string) TimeRange::fromMinutes(13 * 60, TimeRange::DAY_END));
|
||||
self::assertSame('09:00–13:00', (string) TimeRange::fromMinutes(9 * 60, 13 * 60));
|
||||
self::assertSame('ganztägig', (string) TimeRange::wholeDay());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<TimeRange> $ranges
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user