next() and prev() are not symmetrical; prev() is skipping a day that next() includes.
See original GitHub issueExpected Behavior
A call to next()
is symmetrical with a call to prev()
.
Actual Behavior
A call to next()
produces Sat
whereas a call to prev()
skips Sat
and instead produces Fri
.
var cronParser = require("cron-parser")
const options = {
currentDate: new Date("Tue 03 Jan 2017 00:00:00 UTC"),
utc: true
};
const interval = cronParser.parseExpression("0 30 15 * * 1-6", options);
console.log(interval.prev().toDate().toUTCString()); // Mon
console.log(interval.prev().toDate().toUTCString()); // Fri
console.log(interval.next().toDate().toUTCString()); // Sat
console.log(interval.next().toDate().toUTCString()); // Mon
console.log(interval.prev().toDate().toUTCString()); // Fri
https://runkit.com/5912594388e92a00122cb663/5912594388e92a00122cb664
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How to skip span element using jQuery next function?
1. If you know the span is always there, you could just do next().next('.prev') . The selector for the next operates as a...
Read more >Difference between next() and nextLine() methods in Java
In this article, the difference between these two methods is discussed. next() Method: The next() method in java is present in the Scanner...
Read more >Statistics: Power from Data! Organizing data: Stem and leaf plots
A stem and leaf plot looks something like a bar graph. Each number in the data is broken down into a stem and...
Read more >PROGRESS BASIC QUERY COURSE - Maine.gov
The WHERE clause limits record retrieval based on a condition (expression). FIND [FIRST/NEXT/PREV/LAST] table-name WHERE condition. NO-LOCK. EXAMPLE 7:.
Read more >Bug descriptions — spotbugs 4.7.3 documentation
Examples include hash code and equals problems, cloneable idiom, dropped exceptions, ... However, its next() method is not capable of throwing java.util.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think https://github.com/harrisiirak/cron-parser/pull/101 should fix this.
@harrisiirak @santigimeno I’ve meant to work on this, but life has been pretty hectic. To me this bug still seems to exist, both on master and on #99. I’ll try to dig into this sometime this week.