Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
DateTime should support both point and comma characters for parsing a ISO8601 string #35576
I am trying to convert a date time from a string to a 8601 format into a Dart DateTime instance.
The library is currently always using a ',' (comma) character to separate the decimal fraction.
is converted by the library to the string: "2019-01-06T11:39:00,0"
When this is sent (using the JSON format) to a flutter dart application where the string is to be converted to a Dart DateTime object using the parse feature like:
DateTime dateTime = DateTime.parse("2019-01-06T11:39:00**,**0") --> is throwing an exception.
This is correct while it follows the specification of the DateTime implementation in Dart where the decimal fraction may only be a '.' (point) character.
I want to propose that this is changed in the Dart implementation, while following the ISO8601 specification it could be both a point or a comma, where even the comma is preferred!
I think this should be implemented in Dart or else my server implementation is getting the burden to have knowledge about the the client where the date time is generated for. The Dart DateTime should be able to convert both styles.