       not_flat = Meteor.users.find("profile.admin": true).map (admin) -> admin?.profile?.events or []
       event_ids = event_ids.concat.apply(event_ids, not_flat)
     # TODO: Add sorting to EVERY Events.find, especially the category search and normal search
-    Events.find({_id: {$in: event_ids}}, {sort: {date_start: 1, time_start: 1}}).fetch()
+    Events.find({_id: {$in: event_ids}}, {sort: {from: 1}}).fetch()
 
 # user template
 Template.user.helpers

  'mine': ->
    Meteor.user()?.profile?.events.indexOf(@_id) > -1
  'when': ->
    dateStart = moment(@date_start, "YYYY-MM-DD")
    timeStart = moment(@time_start, "hh-mm")

    dateEnd = moment(@date_end, "YYYY-MM-DD")
    timeEnd = moment(@time_end, "hh-mm")

    from = dateStart.hour(timeStart.hour()).minute(timeStart.minute())
    to = dateEnd.hour(timeEnd.hour()).minute(timeEnd.minute())

    "#{from.format('lll')} - #{to.format('lll')}"

Template.all.helpers
  'all_events': -> Events.find().fetch()

        sameElse : 'dddd, L[,] LT'
    }
})

DATE_FORMAT = "YYYY-MM-DD"
TIME_FORMAT = "HH:mm"

# convert undefined, single category to array
fix_categories = (categories) ->
