rackerlabs/atom-hopper — pull request #269 by shintasmith (2014-03-24 22:35:30+00:00)
Title: B-37937: fix issue of wrongly calculating the entry found with the specified timestamp

When we're doing query to find the entries with the specified timestamp, I was initially doing:
```order by datelastupdated desc, id desc``` for direction=backward and ```order by datelastupdated asc, id asc``` for direction=forward.

That was the wrong query. The corrected one would be: ```order by datelastupdated desc, id asc``` for direction=backward and ```order by datelastupdated asc, id desc``` for direction=forward.

If we are paging backward, we want to get the smallest id (the oldest) of the entries with the timestamp specified so that the previous page that is built will contain only entries with older timestamp and smaller IDs.

If we are paging forward, we want to get the biggest id (the most recent) of the entries with the timestamp specified so that the next page that is built will contain only entries with newer timestamp and bigger IDs.