1 (edited by Smorg 2025-11-17 19:35:47)

Topic: Sort order of events starting at the same time

Hi, where is the sort order being controlled?

Currently, it seems to be sorting by when the entry was made, which is leading to confusion amongst staff as they see things like this:

18:00 Steve
18:00 Chloe
22:00 Chloe
22:00 Steve

As you can see, it's obvious that Chloe has a double slot, but it looks like Steve doesn't.

Wold be great to see

18:00 Steve
18:00 Chloe
22:00 Steve
22:00 Chloe


Even better would to know where I can inut some <hr>'s to make

18:00 Steve
18:00 Chloe
-------------------------
22:00 Steve
22:00 Chloe


We only use 10, 2, and 6 as bookable slots. smile

Thanks again.

Re: Sort order of events starting at the same time

Hi Smorg,
Edit the file common/retrieve.php and change line 28 from

return $b['adt'] <=> $a['adt'] ; //date-time added (last added at top)

to

return $a['tit'] <=> $b['tit'] ; //title

Now the names will be in alphabetic order.
I will change this also for the next LuxCal version.

To get a horizontal ruler when the time changes is a bit more complicated. You should look in the file views/month.php and in the foreach loop (lines 15 - 36) at the start of each next loop test if the time changed and if so add a '<hr>' at the start of the first "echo" (line 27). I.e.

echo "<hr><div{$draggable} class= . . . .

The time can be found here: $evt['sti']
Roel

Re: Sort order of events starting at the same time

Thanks bud, I wouldnt have thought of even looking in that file

Re: Sort order of events starting at the same time

Update: I used

return $a['cid'] < $b['cid'] ? -1 : 1; //SORT ORDER OF EVENTS WITHIN THE SAME TIME BRACKET

As this uses the sort order of the Categories, which means it's more consistent across the week too.

Re: Sort order of events starting at the same time

OK, great!