Make sure to add 1 when using closestIndex to find the current week of the month
[SonOfLokstallBot.git] / src / tasks.php
index 5e37f6f..5b11cc2 100644 (file)
@@ -11,7 +11,7 @@ $mondays = [
 ];
 $currentMonth = (int)(new DateTimeImmutable())->format('m');
 $currentDayOfMonth = closest((new DateTimeImmutable())->format('d'), $mondays);
-$currentWeekOfMonth = closestIndex($currentDayOfMonth, $mondays);
+$currentWeekOfMonth = closestIndex($currentDayOfMonth, $mondays) + 1;
 
 $taskLists = array_merge(
     isStartOfSeason($currentMonth, $currentDayOfMonth) ? [unlines(map(getStringAndCode)(getTasksForTheSeason(getSeason($currentMonth), $taskMatrix)))] : [],