Please sign in to comment.
Couple modifications to "next date" retrieval.
In requesting the next date, we try to figure out which date that is. There were a couple issues with the current implementation. When you start with a real date, using that as a "pattern" to find the next date from is next to useless...no no, it is useless. So, instead of finding the next date we just check the value and warn the user if its in the past, otherwise we return it as a new date object (wrapped in a time Date in case the user has setup timezone info). When the source is actually a cron pattern, we want to make sure that we are getting the next appropriate date to actually trigger on. The original implementation of this code used while(1). This was changed in 8c158dc but I'm not sure what you really get out of it other than it artificially limits a potential inf. loop (what I don't get is the potential for it...seems very unlikely). Added some test cases to check these cases. Signed-off-by: Nick Campbell <firstname.lastname@example.org>
- Loading branch information...
Showing with 30 additions and 3 deletions.