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

RRule throws error if key is not recognized #34

Closed
fatshotty opened this issue Nov 14, 2013 · 4 comments
Closed

RRule throws error if key is not recognized #34

fatshotty opened this issue Nov 14, 2013 · 4 comments
Labels

Comments

@fatshotty
Copy link

Hello,

Is it possibile to skip this code here: https://github.com/jkbr/rrule/blob/master/lib/rrule.js#L1448

in order to avoid errors while parsing the string?

Thanks in advance

@jkbrzt
Copy link
Owner

jkbrzt commented Nov 24, 2013

@fatshotty I think it's generally good to have it fail loudly when there is an unknown key. But maybe we could add a sort of "strict" flag to the API, e.g.:

RRule.parseString(rfcString, noStrict=false)
RRule.fromString(rfcString, noStrict=false)

What is your use case?

@fatshotty
Copy link
Author

Hello,
thanks for reply.

I have an iCal format file that includes also other keywords suck as description. Now I should remove this keywords in order to avoid RRule throws errors.
I think your suggestion is good. Maybe the unrecognized keywords could be put into a accessible hash data, something like:

rule = RRule.fromString( MY_STRING );
description = rule.special.description;

Thanks again

Fabio

@jkbrzt
Copy link
Owner

jkbrzt commented Nov 24, 2013

Are the extra fields included in the RRULE field? It sounds a bit odd, could you post an example? The special field is a good idea.

@fatshotty
Copy link
Author

Just a misunderstood by me. It's working good.
This issue is not a problem
Sorry ;)

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

No branches or pull requests

2 participants