@if (in_array('birthday', $activeWidgets) && in_array('employees', user_modules()))
@forelse ($upcomingBirthdays as $upcomingBirthday) {{ $upcomingBirthday->date_of_birth->translatedFormat('d M') }} @php $currentYear = now(company()->timezone)->year; $year = $upcomingBirthday->date_of_birth->timezone(company()->timezone)->year(date('Y')); $dateBirth = $upcomingBirthday->date_of_birth->format($currentYear . '-m-d'); $dateBirth = \Carbon\Carbon::parse($dateBirth); $diffInDays = $year->copy()->diffForHumans(now()->timezone(company()->timezone),[ 'syntax' => \Carbon\CarbonInterface::DIFF_RELATIVE_AUTO, 'options' => \Carbon\Carbon::JUST_NOW | \Carbon\Carbon::ONE_DAY_WORDS | \Carbon\Carbon::TWO_DAY_WORDS, ]); @endphp @if ($dateBirth->isToday()) @lang('app.today') @else {{ $diffInDays }} @endif @empty @endforelse
@endif