Add end date to sorting SQL only when order is ASC

With regards to #141. After merging #141, it seems the sorting doesn't work at all when order is set to DESC.

This patch adds `end` date to sorting only when order is ASC.

As result, `$order = 'DESC'` works and `$order = 'ASC'` works as described in #141.