Closed h4cc closed 2 years ago
When using the ecto type, the user input from a form is directly given to Parser.parse/2 function. The parser does not accept leading/trailing whitespace :(
iex(19)> Crontab.CronExpression.Parser.parse("* * * * *") {:ok, ~e[* * * * * *]} iex(20)> Crontab.CronExpression.Parser.parse("* * * * * ") {:error, "Can't parse as interval year."}
Is there a way to avoid that?
@h4cc That makes sense. I would like to add a String.trim inside the cast of the Ecto.Type and not in the parser itself.
String.trim
cast
Ecto.Type
Would you be willing to open a PR?
Closing in favor of #89
When using the ecto type, the user input from a form is directly given to Parser.parse/2 function. The parser does not accept leading/trailing whitespace :(
Is there a way to avoid that?