protected static function genCalList($unit = 'day', $abbr = false, $start = 1, $case = null)
{
$source = $unit == 'month' ? static::months() : static::days();
$total = count($source);
if ($start < 1 || $start > $total) {
throw new InvalidConfigException("The start '{$unit}' must be between 1 and {$total}.");
}
$converted = [];
foreach ($source as $key => $value) {
$data = $abbr ? substr($value, 0, 3) : $value;
if ($case == 'upper') {
$data = strtoupper($data);
} elseif ($case == 'lower') {
$data = strtolower($data);
}
if ($start == 1) {
$i = $key;
} else {
$i = $key - $start + 1;
if ($i < 1) {
$i += $total;
}
}
$converted[$i] = $data;
}
return ksort($converted) ? $converted : $source;
}