diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb index 704f865..8ba0f71 100644 --- a/app/views/common/_calendar.html.erb +++ b/app/views/common/_calendar.html.erb @@ -3,6 +3,10 @@ only_appointments = params[:only_appointments] == '1' hide_past_weeks = params[:hide_past_weeks] == '1' + # Current date context + today = User.current.today + is_current_month = (calendar.instance_variable_get(:@month) == today.month && calendar.instance_variable_get(:@year) == today.year) + # Get Redmine's configured non-working week days (e.g., ["6", "7"] for Sat/Sun) non_working_days = Setting.non_working_week_days || [] @@ -66,6 +70,25 @@
+ <% if is_current_month %> + + <% else %> + <%= link_to url_for(request.query_parameters.merge(year: today.year, month: today.month)), + class: 'button-small', + style: 'display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-weight: 600; font-size: 0.9em; padding: 4px 10px; border-radius: 3px;', + title: l(:label_today) do %> + + <%= l(:label_today,) %> + <% end %> + <% end %> +