init Date fromString returns nil when 2017-10-15
fabiwerneck opened this issue · 4 comments
fabiwerneck commented
m3rLin0WoRK commented
same issue with 1972-05-28
m3rLin0WoRK commented
Ok, I have found solution.
On daylight saving dates the parser return nil. 2017-10-15 in Brazil for example at 00:00 is an invalid date.
You can patch this with isLenient flag enabled or pass date with valid hour.
melvitax commented
@m3rLin0WoRK Let me know if this fixes your issue
m3rLin0WoRK commented
Yes this work, but be careful because an invalid date like 2017-02-30 return a valid Date (first of March) that in certain cases could not be the desired result.