mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-11-17 21:50:37 -05:00
Calendar review fixes; working day hours setting
- Issues' estimated hours are spread over their working days from start to due date, instead of counted in full on both the start and due dates - Tooltips in the two rightmost columns open leftward again (the rule targeted the old table layout) - Today scrolls when today is on the page (the check read calendar values that don't exist) - "Day N of M" on calendar cards and My Page skips holidays; My Page uses the user's date - Each appointment's working days are worked out once per page (CustomerAppointment#working_days), and shared by placement, hours, day numbers and the end date - The calendar toggles are kept in the session, so changing month loads the page once - Clicking inside an open tooltip keeps it open; estimates load with the appointments - Hours in a working day is a plugin setting (default 8) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ae522baf63
commit
3a5d83aa69
12 files changed
+148
-187
No files matched your search
@@ -1,25 +1,7 @@
|
||||
<%
|
||||
non_working_days = Setting.non_working_week_days || []
|
||||
app_datetime = (appointment.respond_to?(:date) && appointment.date.present?) ? appointment.date : appointment.start_date
|
||||
start_date = app_datetime.to_date
|
||||
target_date = day.to_date
|
||||
# Which working day of the appointment this is (the calendar passes it; weekends and holidays skipped)
|
||||
duration = [appointment.duration.to_i, 1].max
|
||||
|
||||
day_number = 0
|
||||
if target_date >= start_date
|
||||
date_cursor = start_date
|
||||
working_count = 0
|
||||
while date_cursor <= target_date
|
||||
unless non_working_days.include?(date_cursor.cwday.to_s)
|
||||
working_count += 1
|
||||
end
|
||||
if date_cursor == target_date
|
||||
day_number = working_count
|
||||
break
|
||||
end
|
||||
date_cursor += 1
|
||||
end
|
||||
end
|
||||
day_number = local_assigns[:day_number] || appointment.working_day_number(day).to_i
|
||||
%>
|
||||
|
||||
<%
|
||||
|
||||
Reference in new issue
Block a user