File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,16 @@ class DateTime implements Comparable<DateTime> {
259
259
/// * `"2012-02-27T14+00:00"`
260
260
/// * `"-123450101 00:00:00 Z"` : in the year -12345.
261
261
/// * `"2002-02-27T14:00:00-0500"` : Same as `"2002-02-27T19:00:00Z"`
262
- // TODO(lrn): restrict incorrect values like 2003-02-29T50:70:80.
263
- // Or not, that may be a breaking change.
262
+ ///
263
+ /// This method accepts out-of-range component values and interprets
264
+ /// them as overflows into the next larger component.
265
+ /// For example, "2020-01-42" will be parsed as 2020-02-11, because
266
+ /// the last valid date in that month is 2020-01-31, so 42 days is
267
+ /// interprted as 31 days of that month plus 11 days into the next month.
268
+ ///
269
+ /// To detect and reject invalid component values, use
270
+ /// [DateFormat.parseStrict] (https://pub.dev/documentation/intl/latest/intl/DateFormat/parseStrict.html)
271
+ /// from the [intl] (https://pub.dev/packages/intl) package.
264
272
static DateTime parse (String formattedString) {
265
273
var re = _parseFormat;
266
274
Match ? match = re.firstMatch (formattedString);
You can’t perform that action at this time.
0 commit comments