Zeiterfassung Update

* Monatsansicht für Mitarbeiter nun 3 Monate in der Zukunft
This commit is contained in:
Daniel Spitzer
2025-10-11 17:29:05 +02:00
parent c5ef436920
commit 06a148c915
3 changed files with 17 additions and 11 deletions

View File

@@ -30,14 +30,19 @@ $monthger = [
$month = [];
$date = new DateTime('first day of this month');
$time = time();
$timenow = $time;
for ($i = 1; $i <= 12; $i++) {
$mon = $date->format('n');
$year = $date->format('Y');
$month[$date->getTimestamp()] = $monthger[$mon] . " " . $year;
$date->modify('-1 month');
$time = strtotime('first day of this month', $time);
$time = strtotime('+3 month', $time);
for ($i = 1; $i <= 15; $i++) {
$mon = date('n', $time);
$year = date('Y', $time);
$month[$time] = $monthger[$mon] . " " . $year;
$time = strtotime('-1 month', $time);
}
$years[time() + 31536000] = date('Y', time() + 31536000);
$years[time()] = date('Y', time());
$years[time() - 31536000] = date('Y', time() - 31536000);
@@ -305,7 +310,8 @@ $mindate = date("Y-m-d", strtotime("+ 1 Month", $closedmonth));
<div class="input-group">
<select id="datamonth" class="form-control select2">
<?php foreach ($month as $key => $Month): ?>
<option value="<?= $key ?>"><?= $Month ?></option>
<option <?= (date("Y-m", $timenow) == date("Y-m", $key)) ? 'selected="selected"' : '' ?>
value="<?= $key ?>"><?= $Month ?></option>
<?php endforeach; ?>
</select>
</div>