feat: add TurkeyHolidayHelper to exclude official holidays from intern day calculations and logs
This commit is contained in:
@@ -177,7 +177,7 @@ class CareerController extends Controller
|
||||
$temp = $startDate->copy();
|
||||
|
||||
while ($count < $daysToAdd) {
|
||||
if ($temp->isWeekend()) {
|
||||
if ($temp->isWeekend() || \App\Helpers\TurkeyHolidayHelper::isHoliday($temp)) {
|
||||
$temp->addDay();
|
||||
continue;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ class CareerController extends Controller
|
||||
$count = 0;
|
||||
|
||||
while ($count < $daysToAdd) {
|
||||
if ($temp->isWeekend()) {
|
||||
if ($temp->isWeekend() || \App\Helpers\TurkeyHolidayHelper::isHoliday($temp)) {
|
||||
$temp->addDay();
|
||||
continue;
|
||||
}
|
||||
@@ -501,9 +501,9 @@ class CareerController extends Controller
|
||||
return response()->json(['success' => false, 'message' => 'İleriye dönük staj günleri için defter doldurulamaz.'], 422);
|
||||
}
|
||||
|
||||
// 2. Prevent weekend entries
|
||||
if ($dateObj->isWeekend()) {
|
||||
return response()->json(['success' => false, 'message' => 'Hafta sonu günlerine staj günlüğü girilemez.'], 422);
|
||||
// 2. Prevent weekend and holiday entries
|
||||
if ($dateObj->isWeekend() || \App\Helpers\TurkeyHolidayHelper::isHoliday($dateObj)) {
|
||||
return response()->json(['success' => false, 'message' => 'Hafta sonu günlerine ve resmi tatillere staj günlüğü girilemez.'], 422);
|
||||
}
|
||||
|
||||
// 3. Determine if retroactive
|
||||
|
||||
Reference in New Issue
Block a user