3 month limit setup

This commit is contained in:
2025-10-04 13:52:17 +02:00
parent 64d5a8fbf3
commit 45c192058a
2 changed files with 24 additions and 0 deletions
+10
View File
@@ -406,9 +406,19 @@ class Service_model extends CI_Model {
public function getAvailableTimes($worker_id, $selectedDate, $servicelength) {
$this->load->database();
if (strtotime($selectedDate) < strtotime(date('Y-m-d'))) {
return [];
}
$today = new DateTime();
$maxDate = (clone $today)->modify('+3 months');
$selected = new DateTime($selectedDate);
if ($selected > $maxDate) {
return [];
}
$ts = strtotime($selectedDate);
$debugDate = date('Y-m-d (w)', $ts) . ' - ' . date('l', $ts);
log_message('error', "📅 DEBUG DATE CHECK for '{$selectedDate}': {$debugDate}");