Title: Time Sort
Last modified: August 24, 2016

---

# Time Sort

 *  Resolved [nquaist](https://wordpress.org/support/users/nquaist/)
 * (@nquaist)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/time-sort/)
 * Hi,
 * I saw that a year ago someone, asked about sorting by time. Could you let me 
   know if this functionality has been developed? if not how should I proceed to
   sort by time?
 * Thanks
 * [https://wordpress.org/plugins/event-list/](https://wordpress.org/plugins/event-list/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [nquaist](https://wordpress.org/support/users/nquaist/)
 * (@nquaist)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/time-sort/#post-6114661)
 * Hi,
 * I went to the code and db, apparently the Time field is a text field so, when
   ascending, it start from 0 to 9. So, if hour is 8 am it will be after 10 am.
   
   Do you plan to have this changed, my idea is to create a new time field (time
   format named ntime) and copy all the data from time to ntime then change the 
   filter public function get_events($date_filter=null, $cat_filter=null, $num_events
   =0, $sort_array=array(‘start_date ASC’, ‘time ASC’, ‘end_date ASC’))
 * to
 * public function get_events($date_filter=null, $cat_filter=null, $num_events=0,
   $sort_array=array(‘start_date ASC’, ‘ntime ASC’, ‘end_date ASC’))
    Do you have
   any other idea?
 * Thanks
 *  [SchmidtsReunite](https://wordpress.org/support/users/schmidtsreunite/)
 * (@schmidtsreunite)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/time-sort/#post-6115004)
 * This is an excellent question. I had the same one. Here’s a work-around I discovered
   that will correctly sort different timed events on the same day:
 * Put the AM or PM first. Then, if the hour has only one digit, put a zero in front
   of it. For instance:
 * AM 06:00
    AM 10:00 PM 02:00 PM 07:30
 * Because “A” comes before “P” in the alphabet, the AM events will always be sorted
   first, and the PM events will be sorted second. Moreover, adding a “0” in front
   of single digit hours ensures that 10:00 will not be sorted before 8:00.
 * It looks kind of ugly, but at least it’s functional.
 *  [SchmidtsReunite](https://wordpress.org/support/users/schmidtsreunite/)
 * (@schmidtsreunite)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/time-sort/#post-6115006)
 * I would just add that, in my above-stated workaround, the PM 12:00 would get 
   sorted incorrectly, so I’ve been using “NOON 12:00” to get it to sort between
   the AM and PM entries.
 *  Plugin Author [mibuthu](https://wordpress.org/support/users/mibuthu/)
 * (@mibuthu)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/time-sort/#post-6115013)
 * I will have a look at it and I will try to fix this in the next version.
 *  [WSheedy](https://wordpress.org/support/users/wsheedy/)
 * (@wsheedy)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/time-sort/#post-6115026)
 * I was looking for a way to get multiple events on a given day to appear in time
   order. This works and we will use for now. Other than that your plugin was just
   what we were looking for.
 *  [John](https://wordpress.org/support/users/jiglet/)
 * (@jiglet)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/time-sort/#post-6115029)
 * Great plugin, but this seems like a serious oversight. Using this for a wedding
   website for a “schedule of events” and they all take place over the span of 2-
   3 days. If we can’t sort them by time, we can’t use this. Has the issue been 
   addressed in some capacity yet?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Time Sort’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/event-list_f8f8f8.svg)
 * [Event List](https://wordpress.org/plugins/event-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-list/)
 * [Active Topics](https://wordpress.org/support/plugin/event-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-list/reviews/)

 * 6 replies
 * 5 participants
 * Last reply from: [John](https://wordpress.org/support/users/jiglet/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/time-sort/#post-6115029)
 * Status: resolved