Mood Tracker
Rekod mood harian anda untuk memantau kesejahteraan emosi
{{ session('success') }}
@endif
Mood Pilihan
{{ \Carbon\Carbon::create($currentYear, $currentMonth)->translatedFormat('F Y') }}
Ahad
Isnin
Selasa
Rabu
Khamis
Jumaat
Sabtu
@php
$date = \Carbon\Carbon::create($currentYear, $currentMonth, 1);
$startOfMonth = $date->copy()->startOfMonth();
$endOfMonth = $date->copy()->endOfMonth();
$startDay = $startOfMonth->dayOfWeek; // 0 = Sunday
// Empty cells before month starts
for ($i = 0; $i < $startDay; $i++) {
echo '';
}
// Days of the month
for ($day = 1; $day <= $endOfMonth->day; $day++) {
$currentDate = \Carbon\Carbon::create($currentYear, $currentMonth, $day);
$dateString = $currentDate->format('Y-m-d');
$isToday = $currentDate->isToday();
$mood = $moods[$dateString] ?? null;
$classes = 'calendar-day';
if ($isToday) $classes .= ' today';
if ($mood) $classes .= ' has-mood';
echo '';
echo '
';
}
@endphp
' . $day . '
';
if ($mood) {
echo '' . $mood->emoji . '
';
}
echo '