Files
online.tbbank.gov.tm-larave…/app/Modules/DateHelper/Repositories/DateHelperRepository.php
2025-02-21 00:56:03 +05:00

31 lines
560 B
PHP

<?php
namespace App\Modules\DateHelper\Repositories;
class DateHelperRepository
{
public static function monthsAsNumber(): array
{
$month = [];
for ($m = 1; $m <= 12; $m++) {
$month[] = str_pad(strval($m), 2, '0', STR_PAD_LEFT);
}
return $month;
}
public static function yearsUntil(int $max = 50): array
{
$years = [];
$currentData = 2024;
for ($i = 0; $i <= $max; $i++) {
$years[] = intval($currentData) + $i;
}
return $years;
}
}