mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-10 05:56:09 +01:00
Make untilDate to requirement
This commit is contained in:
parent
aa38792554
commit
b5d89ce7c4
2 changed files with 5 additions and 3 deletions
|
@ -372,13 +372,14 @@ class DestinationDataImportService {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ($date['freq'] == 'Daily' && empty($date['weekdays'])) {
|
if ($date['freq'] == 'Daily' && empty($date['weekdays']) && !empty($date['repeatUntil'])) {
|
||||||
|
|
||||||
$this->logger->info('Setup daily interval dates');
|
$this->logger->info('Setup daily interval dates');
|
||||||
$this->logger->info('Start ' . $date['start']);
|
$this->logger->info('Start ' . $date['start']);
|
||||||
$this->logger->info('End ' . $date['repeatUntil']);
|
$this->logger->info('End ' . $date['repeatUntil']);
|
||||||
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
|
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
|
||||||
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
|
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
|
||||||
|
|
||||||
for($i = strtotime($start->format('l'), $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 day', $i)) {
|
for($i = strtotime($start->format('l'), $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 day', $i)) {
|
||||||
if ($i >= $today) {
|
if ($i >= $today) {
|
||||||
$eventStart = new \DateTime();
|
$eventStart = new \DateTime();
|
||||||
|
@ -396,13 +397,14 @@ class DestinationDataImportService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($date['freq'] == 'Weekly' && !empty($date['weekdays'])) {
|
else if ($date['freq'] == 'Weekly' && !empty($date['weekdays']) && !empty($date['repeatUntil'])) {
|
||||||
foreach ($date['weekdays'] as $day) {
|
foreach ($date['weekdays'] as $day) {
|
||||||
$this->logger->info('Setup weekly interval dates for ' . $day);
|
$this->logger->info('Setup weekly interval dates for ' . $day);
|
||||||
$this->logger->info('Start ' . $date['start']);
|
$this->logger->info('Start ' . $date['start']);
|
||||||
$this->logger->info('End ' . $date['repeatUntil']);
|
$this->logger->info('End ' . $date['repeatUntil']);
|
||||||
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
|
$start = new \DateTime($date['start'], new \DateTimeZone($date['tz']));
|
||||||
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
|
$until = new \DateTime($date['repeatUntil'], new \DateTimeZone($date['tz']));
|
||||||
|
|
||||||
for($i = strtotime($day, $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 week', $i)) {
|
for($i = strtotime($day, $start->getTimestamp()); $i <= $until->getTimestamp(); $i = strtotime('+1 week', $i)) {
|
||||||
if ($i >= $today) {
|
if ($i >= $today) {
|
||||||
$eventStart = new \DateTime();
|
$eventStart = new \DateTime();
|
||||||
|
|
|
@ -23,7 +23,7 @@ plugin.tx_events {
|
||||||
# cat=plugin.tx_events//a; type=string; label=Data Type
|
# cat=plugin.tx_events//a; type=string; label=Data Type
|
||||||
restType = Event
|
restType = Event
|
||||||
# cat=plugin.tx_events//a; type=string; label=Data Limit
|
# cat=plugin.tx_events//a; type=string; label=Data Limit
|
||||||
restLimit = 200
|
restLimit = 500
|
||||||
# cat=plugin.tx_events//a; type=string; label=Mode
|
# cat=plugin.tx_events//a; type=string; label=Mode
|
||||||
restMode = next_months,12
|
restMode = next_months,12
|
||||||
# cat=plugin.tx_events//a; type=string; label=Data Template
|
# cat=plugin.tx_events//a; type=string; label=Data Template
|
||||||
|
|
Loading…
Reference in a new issue