mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-21 21:16:11 +01:00
Respect that interval is now always set within timeIntervals
The property will always be set in the future. We no longer can use it as an indicator. We switch to freq as new indicator. We also ensure that start has to be given for a single date. Relates: #9892
This commit is contained in:
parent
425da4bb33
commit
c506720689
3 changed files with 20 additions and 16 deletions
|
@ -45,7 +45,11 @@ class DatesFactory
|
|||
|
||||
private function isDateSingleDate(array $date): bool
|
||||
{
|
||||
return empty($date['interval']);
|
||||
$frequency = $date['freq'] ?? '';
|
||||
$start = $date['start'] ?? '';
|
||||
|
||||
return $frequency === ''
|
||||
&& $start !== '';
|
||||
}
|
||||
|
||||
private function isDateInterval(array $date): bool
|
||||
|
|
|
@ -90,7 +90,8 @@
|
|||
"weekdays": [],
|
||||
"start": "2099-12-19T15:00:00+01:00",
|
||||
"end": "2099-12-19T16:30:00+01:00",
|
||||
"tz": "Europe/Berlin"
|
||||
"tz": "Europe/Berlin",
|
||||
"interval": 1
|
||||
}
|
||||
],
|
||||
"kitchenTimeIntervals": [],
|
||||
|
@ -256,7 +257,8 @@
|
|||
"weekdays": [],
|
||||
"start": "2099-12-16T15:00:00+01:00",
|
||||
"end": "2099-12-16T16:30:00+01:00",
|
||||
"tz": "Europe/Berlin"
|
||||
"tz": "Europe/Berlin",
|
||||
"interval": 1
|
||||
},
|
||||
{
|
||||
"weekdays": [],
|
||||
|
@ -271,7 +273,8 @@
|
|||
"weekdays": [],
|
||||
"start": "2099-02-17T15:00:00+01:00",
|
||||
"end": "2099-02-17T17:00:00+01:00",
|
||||
"tz": "Europe/Berlin"
|
||||
"tz": "Europe/Berlin",
|
||||
"interval": 1
|
||||
}
|
||||
],
|
||||
"kitchenTimeIntervals": [],
|
||||
|
@ -436,7 +439,8 @@
|
|||
"weekdays": [],
|
||||
"start": "2099-12-01T19:00:00+01:00",
|
||||
"end": "2099-12-01T20:00:00+01:00",
|
||||
"tz": "Europe/Berlin"
|
||||
"tz": "Europe/Berlin",
|
||||
"interval": 1
|
||||
},
|
||||
{
|
||||
"weekdays": [
|
||||
|
@ -454,7 +458,8 @@
|
|||
"weekdays": [],
|
||||
"start": "2099-12-22T19:00:00+01:00",
|
||||
"end": "2099-12-22T20:00:00+01:00",
|
||||
"tz": "Europe/Berlin"
|
||||
"tz": "Europe/Berlin",
|
||||
"interval": 1
|
||||
}
|
||||
],
|
||||
"kitchenTimeIntervals": [],
|
||||
|
|
|
@ -46,18 +46,9 @@ class DatesFactoryTest extends TestCase
|
|||
'Empty Intervals' => [
|
||||
'unkownInput' => [],
|
||||
],
|
||||
'Intervals with interval no repeatUntil' => [
|
||||
'Single interval without values' => [
|
||||
'unkownInput' => [
|
||||
[
|
||||
'interval' => 1,
|
||||
],
|
||||
],
|
||||
],
|
||||
'Intervals with interval and repeatUntil bu no freq' => [
|
||||
'unkownInput' => [
|
||||
[
|
||||
'interval' => 1,
|
||||
'repeatUntil' => 'something',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -75,6 +66,7 @@ class DatesFactoryTest extends TestCase
|
|||
'start' => '2099-06-21T16:00:00+02:00',
|
||||
'end' => '2099-06-21T22:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
'interval' => 1,
|
||||
]], false);
|
||||
|
||||
self::assertInstanceOf(\Generator::class, $result);
|
||||
|
@ -100,6 +92,7 @@ class DatesFactoryTest extends TestCase
|
|||
'start' => '2099-06-21T16:00:00+02:00',
|
||||
'end' => '2099-06-21T22:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
'interval' => 1,
|
||||
]], true);
|
||||
|
||||
self::assertInstanceOf(\Generator::class, $result);
|
||||
|
@ -258,6 +251,7 @@ class DatesFactoryTest extends TestCase
|
|||
'start' => '2099-06-21T16:00:00+02:00',
|
||||
'end' => '2099-06-21T22:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
'interval' => 1,
|
||||
],
|
||||
[
|
||||
'start' => '2099-04-01T16:00:00+02:00',
|
||||
|
@ -304,6 +298,7 @@ class DatesFactoryTest extends TestCase
|
|||
'start' => '2099-06-21T16:00:00+02:00',
|
||||
'end' => '2099-06-21T22:00:00+02:00',
|
||||
'tz' => 'Europe/Berlin',
|
||||
'interval' => 1,
|
||||
],
|
||||
[
|
||||
'start' => '2099-04-01T16:00:00+02:00',
|
||||
|
|
Loading…
Reference in a new issue