@if (in_array('notice_period_duration', $activeWidgets) && in_array('employees', user_modules())) @php $currentDay = \Carbon\Carbon::parse(now(company()->timezone)->toDateTimeString()) ->startOfDay() ->setTimezone('UTC'); @endphp
@if (in_array('admin', user_roles())) @forelse ($noticePeriod as $noticePrd) @php $noticePeriodEndDate = Carbon\carbon::parse($noticePrd->notice_period_end_date); $noticePeriodStartDate = Carbon\carbon::parse($noticePrd->notice_period_start_date); $diffInDays = $noticePeriodEndDate->copy()->diffForHumans($currentDay); @endphp @if ($noticePeriodEndDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif ($noticePeriodEndDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif
{{ $noticePeriodStartDate->translatedFormat($company->date_format) . ' - ' . $noticePeriodEndDate->translatedFormat($company->date_format) }} @empty @endforelse
@else @if ($noticePeriod) @php $noticePeriodStartDate = Carbon\carbon::parse($noticePeriod->notice_period_start_date); $noticePeriodEndDate = Carbon\carbon::parse($noticePeriod->notice_period_end_date); $diffInDays = $noticePeriodEndDate->copy()->diffForHumans($currentDay); @endphp @if ($noticePeriodEndDate->setTimezone(company()->timezone)->isToday()) {{ $noticePeriodStartDate->translatedFormat($company->date_format) . ' - ' . $noticePeriodEndDate->translatedFormat($company->date_format) }} @elseif ($noticePeriodEndDate->diffInDays($currentDay) <= 7) {{ $noticePeriodStartDate->translatedFormat($company->date_format) . ' - ' . $noticePeriodEndDate->translatedFormat($company->date_format) }} @else {{ $noticePeriodStartDate->translatedFormat($company->date_format) . ' - ' . $noticePeriodEndDate->translatedFormat($company->date_format) }} @endif @if ($noticePeriodEndDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif ($noticePeriodEndDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif @endif @endif
@endif