Add brettspill, drift and hack activities #35

Merged
felixalbrigtsen merged 2 commits from 2023events into master 2023-01-16 16:26:02 +01:00
3 changed files with 7 additions and 5 deletions
Showing only changes of commit 699876405c - Show all commits

View File

@ -13,7 +13,7 @@ class BrettspillActivity implements Activity {
$date = $date->setTime(16, 15, 0);
if ($date->format('N') != 7)
return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2 - 1)
if ($date->format('W') % 2)
return $this->nextDate($date->add(new DateInterval('P7D')));
return $date;
}
@ -24,6 +24,8 @@ class BrettspillActivity implements Activity {
$date = $date->setTime(16, 15, 0);
if ($date->format('N') != 7)
return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2)
return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date;
}

View File

@ -13,7 +13,7 @@ class DriftkveldActivity implements Activity {
$date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6)
return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2 - 1)
if ($date->format('W') % 2)
return $this->nextDate($date->add(new DateInterval('P7D')));
return $date;
}
@ -24,7 +24,7 @@ class DriftkveldActivity implements Activity {
$date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6)
return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2 - 1)
if ($date->format('W') % 2)
return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date;
}

View File

@ -13,7 +13,7 @@ class HackekveldActivity implements Activity {
$date = $date->setTime(16, 15, 0);
if ($date->format('N') != 6)
return $this->nextDate($date->add(new DateInterval('P1D')));
if ($date->format('W') % 2)
if ($date->format('W') % 2 - 1)
return $this->nextDate($date->add(new DateInterval('P7D')));
return $date;
}
@ -24,7 +24,7 @@ class HackekveldActivity implements Activity {
$date = $date->setTime(18, 15, 0);
if ($date->format('N') != 6)
return $this->prevDate($date->sub(new DateInterval('P1D')));
if ($date->format('W') % 2)
if ($date->format('W') % 2 - 1)
return $this->prevDate($date->sub(new DateInterval('P7D')));
return $date;
}