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

Issue with Monthly rrule #231

Closed
skyskyskyblue opened this issue Aug 2, 2018 · 4 comments
Closed

Issue with Monthly rrule #231

skyskyskyblue opened this issue Aug 2, 2018 · 4 comments

Comments

@skyskyskyblue
Copy link

I am using 2.2.9v. It seems it cannot show the past time.
Today is 02/08/2018, if I use the string:
"DTSTART=20180802T000000Z;FREQ=MONTHLY;BYMONTHDAY=2;BYSETPOS=-1"
the results are:
"2018-09-02T00:00:00.000Z",
"2018-10-02T00:00:00.000Z",
"2018-11-02T01:00:00.000Z",
"2018-12-02T01:00:00.000Z",
"2019-01-02T01:00:00.000Z",
"2019-02-02T01:00:00.000Z",
"2019-03-02T01:00:00.000Z",
"2019-04-02T00:00:00.000Z",
"2019-05-02T00:00:00.000Z",
"2019-06-02T00:00:00.000Z",
..............
without 2018-08-02.

What I expect is including today (2018-08-02).
But it seems it works fine on the website.

@davidgoli
Copy link
Collaborator

@skyskyskyblue can you please show the rrule code you're using to generate this? (eg all, between, etc)

@davidgoli
Copy link
Collaborator

The times here are also showing the issue in #233

@skyskyskyblue
Copy link
Author

const rule = rrulestr(rulestring);
const now = new Date();
const currentyear = now.getFullYear();
const infiveyears = new Date().setFullYear(currentyear + 5);
return {
               dates: rule.between(now, infiveyears, true),
          };

I see the problem:
I am using "now = new Date()" that means from the current time to 5 years later.
Sorry for the confusion.

@davidgoli
Copy link
Collaborator

Please reopen if you are still having issues.

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

No branches or pull requests

2 participants