Page 1 of 1

Sorting in Calendar Pro

PostPosted: Thu Jul 10, 2014 5:20 am
by jmundok
Is there a way to customize the sort of events in Calendar Pro? I found a thread pointing to a specific sort script, but I'm not seeing that in the latest version.

I would like to sort by start time, but put events that don't have a start time at the end of the sort order.

Re: Sorting in Calendar Pro

PostPosted: Thu Jul 10, 2014 5:30 am
by jeffalmquist
Hi Jason. We consider events with no start time "all-day events", and they appear in their own section at the top of the Day, Week and Schedule views. Are you just saying you'd rather have that all-day section at the bottom of those views instead of at the top? -Jeff

Re: Sorting in Calendar Pro

PostPosted: Thu Jul 10, 2014 9:52 am
by jmundok
Hi Jeff,

The "all day events" are fine as they are on the day and week views, but on the month view they are listed first. This particular client is using them to represent non-events (like a customer pickup). There may be 4 or 5 of those scheduled for a day in addition to 3 or 4 appointments. If I could sort them after the appointments that have a start time, then on the month view, I would see the appointments rather than the all day events. Does this make more sense?

Thanks,
Jason

Re: Sorting in Calendar Pro

PostPosted: Thu Jul 10, 2014 10:19 am
by jeffalmquist
Yeah, that makes sense. You should be able to do that by editing the "ORDER BY" clause in the SQL query. That clause gets added in the "Add Order By" section toward the end of the "Cast Events as Variables - Build Query" script. Right now we're just sorting by the first field in the SELECT clause, which is the starting timestamp field ("ORDER BY 1"). You might have to add a flag field to distinguish "all-day" events from events with start times, then sort by that first ("ORDER BY all_day_flag DESC, 1"). You might also want to add some logic so that only happens on Month View. HTH... Jeff

Re: Sorting in Calendar Pro

PostPosted: Thu Jul 10, 2014 11:06 am
by jmundok
Makes sense. Thanks for pointing out where that is located.

Jason