[x] Your operating system -- Expo SDK 47 w/hermes enabled (react native)
[x] Your local timezone (run $ date from the command line
of the machine showing the bug) -- Mon 8 May 2023 15:58:44 EDT
React Native now defaults to using the hermes js engine which messes up a lot of Date related functionality because it's much more strict on the input it will accept. It seems that the usage of Date.parse in the until code here has been exposed. When passing in a string to the fromText function, I get an error that my input is invalid. The reason is because the input being passed to Date.parse contains a leading space character and Date.parse (in hermes) doesn't know how to deal with this.
Reporting an issue
rrule
you are using -- 2.7.2$ date
from the command line of the machine showing the bug) -- Mon 8 May 2023 15:58:44 EDTReact Native now defaults to using the
hermes
js engine which messes up a lot ofDate
related functionality because it's much more strict on the input it will accept. It seems that the usage ofDate.parse
in the until code here has been exposed. When passing in a string to thefromText
function, I get an error that my input is invalid. The reason is because the input being passed toDate.parse
contains a leading space character andDate.parse
(in hermes) doesn't know how to deal with this.Here is the line of code: https://github.com/jakubroztocil/rrule/blob/35d819ffdd4558335b1a66ffc1f2488149885da6/src/nlp/parsetext.ts#L426
The solution is to add
.trim()
to the value being provided toDate.parse
.Input:
Expected output: an
rrule
objectActual output: