Skip to content

Commit

Permalink
bug fix after work options
Browse files Browse the repository at this point in the history
if first of the next month is a friday, it was included in the options
  • Loading branch information
Nielsvanpach committed Jan 11, 2024
1 parent 60251f8 commit ad00828
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/AfterworkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function handle(): void
$options = collect($this->generatePollOptions())
->map(fn (string $option, int $index) => $this->addEmoji($option, $index))
->implode("\n");

SlackAlert::message("Who is in for an afterwork drink? :beer: :cup_with_straw:\n{$options}");
dd($options);
//SlackAlert::message("Who is in for an afterwork drink? :beer: :cup_with_straw:\n{$options}");

$this->info('Poll posted to Slack');

Check failure on line 25 in app/Console/Commands/AfterworkCommand.php

View workflow job for this annotation

GitHub Actions / phpstan

Unreachable statement - code above always terminates.
}
Expand Down Expand Up @@ -56,7 +56,7 @@ protected function getDatesForWeekdayInMonth(string $dayName): CarbonPeriod
return new CarbonPeriod(
CarbonImmutable::parse("first {$dayName} of this month"),
CarbonInterval::week(),
CarbonImmutable::parse("first {$dayName} of next month")
CarbonImmutable::parse("first {$dayName} of next month")->subDay(),
);
}

Expand Down

0 comments on commit ad00828

Please sign in to comment.