From ad00828683e117c89f7593ff86fd6f3513fab37c Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:14:25 +0100 Subject: [PATCH] bug fix after work options if first of the next month is a friday, it was included in the options --- app/Console/Commands/AfterworkCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/AfterworkCommand.php b/app/Console/Commands/AfterworkCommand.php index fbc0b441..810b4d14 100644 --- a/app/Console/Commands/AfterworkCommand.php +++ b/app/Console/Commands/AfterworkCommand.php @@ -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'); } @@ -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(), ); }