Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron, on Sunday #152

Open
emilbruckner opened this issue Mar 26, 2016 · 3 comments · May be fixed by #171
Open

Cron, on Sunday #152

emilbruckner opened this issue Mar 26, 2016 · 3 comments · May be fixed by #171

Comments

@emilbruckner
Copy link

cron('0 0 * * 6,7') should be on Saturday and Sunday.
1-6 works for Monday to Saturday. It writes 2-7 to .d, but cron 7, which is Sunday, adds 8 to .d, instead of 1.

@bunkat
Copy link
Owner

bunkat commented Mar 29, 2016

Does 0, 6 do what you want? Or SAT, SUN? Or are they all broken at the moment?

@emilbruckner
Copy link
Author

Yes, everything works, no problem. It just caused me a lot of frustration as, according to Wikipedia, 7 should also work.

@pekeler
Copy link
Contributor

pekeler commented May 19, 2016

Yea, this is broken. Weekdays in Cron are

0 SUN
1 MON
2 TUE
3 WED
4 THU
5 FRI
6 SAT
7 SUN

Later's internal representation of weekdays are:

1 SUN
2 MON
3 TUE
4 WED
5 THU
6 FRI
7 SAT

So far so good. The test title

it('should parse 7 as Sunday', function() {
'should parse 7 as Sunday' is correct, but the implementation is incorrect. It should be

        it('should parse 7 as Sunday', function() {
            var p = parse('* * * * * 7', true);
            p.schedules[0].should.eql({d: [1]});
        });

Right now, Later parses '* * * * * 7' as Saturday which is incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants