diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb index f42c350..8229a3a 100644 --- a/app/views/common/_calendar.html.erb +++ b/app/views/common/_calendar.html.erb @@ -97,6 +97,8 @@ <% week.each do |day| %> <% + is_today = (day == User.current.today) + # Filter out standard events if "only appointments" toggle is active standard_events = only_appointments ? [] : calendar.events_on(day).reject { |e| e.is_a?(CustomerAppointment) } @@ -130,12 +132,14 @@ end %> -
- <%= day.day %> + style="text-decoration: none; color: inherit;"> + <%= day.day %> + (<%= abbr_day_name(day.cwday) %>) @@ -247,6 +251,15 @@ if (!urlParams.has('only_appointments') && savedState === '1') { urlParams.set('only_appointments', '1'); window.location.search = urlParams.toString(); + return; + } + + // Automatically scroll to today if present and no specific hash anchor is in the URL + if (!window.location.hash) { + const todayElement = document.getElementById('today'); + if (todayElement) { + todayElement.scrollIntoView({ behavior: 'smooth', block: 'center' }); + } } });