@if (in_array('internship_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 ($internships as $internship) @php $internshipDate = Carbon\carbon::parse($internship->internship_end_date); $diffInDays = $internshipDate->copy()->diffForHumans($currentDay); @endphp @if ($internshipDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif ($internshipDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif
@if ($internshipDate->setTimezone(company()->timezone)->isToday()) @lang('messages.internshipMessage'){{ $internshipDate->translatedFormat($company->date_format) }} @elseif($internshipDate->diffInDays($currentDay) <= 7) @lang('messages.internshipMessage') {{ $internshipDate->translatedFormat($company->date_format) }} @else @lang('messages.internshipMessage') {{ $internshipDate->translatedFormat($company->date_format) }} @endif @empty @endforelse
@else @if ($internship) @php $internshipDate = Carbon\carbon::parse($internship->internship_end_date); $diffInDays = $internshipDate->copy()->diffForHumans($currentDay); @endphp @if ($internshipDate->setTimezone(company()->timezone)->isToday()) @lang('messages.internshipMessage'){{ $internshipDate->translatedFormat($company->date_format) }} @elseif($internshipDate->diffInDays($currentDay) <= 7) @lang('messages.internshipMessage') {{ $internshipDate->translatedFormat($company->date_format) }} @else @lang('messages.internshipMessage') {{ $internshipDate->translatedFormat($company->date_format) }} @endif @if ($internshipDate->setTimezone(company()->timezone)->isToday()) @lang('app.today') @elseif ($internshipDate->diffInDays($currentDay) <= 7) {{ $diffInDays }} @else {{ $diffInDays }} @endif @endif @endif
@endif