Closed kawoon-app closed 3 years ago
Dates are tough - because we don't control their input. I've made a couple of changes in 0.8.1
that should help:
1) Replaced DateComponents with FlexiDate
- I changed the name because the behavior is slightly different. When the library encounters a parsing error, it will still produce an instance of FlexiDate, but it will be marked isValid==false
and the values for month
, day
, and year
will be null. The original
unparsed value will be retained and will be passed back through the library.
2) For the FlexiDate
library, there are two methods for improving parsing: 1) you can provide your own parser by setting FlexiDateParser.instance
. Also, there is a DefaultFlexiDateParser.locale
field which can be set appropriately to the user's locale. This will fix issues such as parsing date tokens in other languages (such as the one provided in this example). The underlying library used for the date parsing is the intl
package.
Hello. We use your plugin in our app and recently faced with this issue. A few of our users told us that they get error while loading contact list. In our code we see PlatformException that points to NumberFormatException while parsing "6 июля 1983".
How to reproduce: