mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
Enhance event sorting by time of day in chronological order
This commit is contained in:
1 parent
b4be49816c
commit
048b7d4198
1 file changed
+4
-4
@@ -82,14 +82,14 @@
|
||||
# Appointments matching duration on this working day
|
||||
matching_appointments = all_appointments.select { |app| appointment_occurs_on.call(app, day) }
|
||||
|
||||
# Sort events chronologically
|
||||
# Sort events chronologically by time of day
|
||||
day_events = (standard_events + matching_appointments).sort_by do |event|
|
||||
if event.is_a?(CustomerAppointment) && event.date.present?
|
||||
event.date.to_time
|
||||
event.date.strftime('%H:%M:%S')
|
||||
elsif event.respond_to?(:start_date) && event.start_date.present?
|
||||
event.start_date.to_time
|
||||
event.start_date.to_time.strftime('%H:%M:%S')
|
||||
else
|
||||
Time.at(0)
|
||||
'00:00:00'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user