saltstack/salt — pull request #11308 by basepi (2014-03-17 23:30:41+00:00)
Title: Rewrite jid comparison for job cache cleanup

Previous iteration was naive, just converted the first 10 characters of
the jid to integers and subtracted. However, that means that any time
we go tick over midnight, it adds 76 to the difference (since hours are
not tracked in base 10). Now, we parse out the jid, convert to a
datetime object, and compare using a timedelta object.

Will not cherry-pick cleanly, so I will submit that as a secondary pull request.