josiahcarlson/parse-crontab — pull request #5 by avandever (2013-06-19 22:19:18+00:00)
Title: Fix skipping matches with a more brute-force search

The problem: The current algorithm for next() can return a too-far answer. Example: '10, 20 15 * * *' will point to 15:20 if run at 14:15, but will give the correct answer (15:10) if run at 15:01. This is true any time a field has a list of values, and the current time's value for that field is greater than any of those values. I've tried (with some friends) to brainstorm a more efficient way to make this work, and there are options like generating a list of all possible matches, and finding the lowest one that is greater than now, but this might be a good place to honor the K.I.S.S. principle.