@if (in_array('probation_date', $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 ($probations as $probation) @php $probationDate = Carbon\carbon::parse($probation->probation_end_date); $diffInDays = $probationDate->copy()->diffForHumans($currentDay); @endphp @if ($probationDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif($probationDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif
@if ($probationDate->setTimezone(company()->timezone)->isToday()) @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @elseif($probationDate->diffInDays($currentDay) <= 7) @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @else @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @endif @empty @endforelse
@else @if ($probation) @php $probationDate = Carbon\carbon::parse($probation->probation_end_date); $diffInDays = $probationDate->copy()->diffForHumans($currentDay); @endphp @if ($probationDate->setTimezone(company()->timezone)->isToday()) @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @elseif($probationDate->diffInDays($currentDay) <= 7) @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @else @lang('messages.probationMessage') {{ $probationDate->translatedFormat($company->date_format) }} @endif @if ($probationDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif($probationDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif @endif @endif
@endif