days: shorten function

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-14 12:44:26 -07:00
parent e255c957f7
commit 03d1f37a29
1 changed files with 1 additions and 8 deletions

View File

@ -262,14 +262,7 @@ class DaysController extends GenericApiController
*/ */
private function monthIdToDayIds(int $monthId): array private function monthIdToDayIds(int $monthId): array
{ {
$dayIds = []; return range($monthId, (int) (strtotime(date('Ymt', $monthId * 86400)) / 86400));
$firstDay = (int) $monthId;
$lastDay = strtotime(date('Ymt', $firstDay * 86400)) / 86400;
for ($i = $firstDay; $i <= $lastDay; ++$i) {
$dayIds[] = $i;
}
return $dayIds;
} }
private function isRecursive(): bool private function isRecursive(): bool