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

Interval not set if it is one #95

Open
Shreyas775 opened this issue Mar 19, 2021 · 3 comments
Open

Interval not set if it is one #95

Shreyas775 opened this issue Mar 19, 2021 · 3 comments

Comments

@Shreyas775
Copy link

Shreyas775 commented Mar 19, 2021

Hi team, I am using lib recur. It generates rrule but removes interval if it is one. In the code part I see that one is default for interval so we remove it. But for my case I want to set an interval even if it is one. Is there any way we can set an interval even if it is one?

@dmfs
Copy link
Owner

dmfs commented Mar 19, 2021

May I ask what your use case is? Why is it important to you to add INTERVAL=1 even though that's the default?

At present there is no way to add INTERVAL=1. You could use a hack like this

public static String toString(RecurrenceRule rule) {
 return rule.getInterval() == 1 ? `rrule.toString() + ";INTERVAL=1"` : rrule.toString();
}

But that's really a hack and not a sound solution and it would break if (for whatever reason) the library adds INTERVAL=1 in a future version.

@Shreyas775
Copy link
Author

Shreyas775 commented Mar 19, 2021 via email

@dmfs
Copy link
Owner

dmfs commented Mar 19, 2021

So you're using the result of toString() to compare the local and remote rrules? Is that correct? I see the issue.
Do you parse the RRule on the local side or do you create with from the individual parts?

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