Chromium Code Reviews| Index: sdk/lib/core/date_time.dart |
| diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart |
| index 0b4a63a19a0c63eb8fe2baa877c109c800b595a6..26ca7ec364ccba1555883a0b534c1b019e08d4a1 100644 |
| --- a/sdk/lib/core/date_time.dart |
| +++ b/sdk/lib/core/date_time.dart |
| @@ -48,7 +48,7 @@ part of dart.core; |
| * unless explicitly created in the UTC time zone. |
| * |
| * DateTime dDay = new DateTime.utc(1944, 6, 6); |
| - * |
| + * |
| * Use [isUtc] to determine whether a DateTime object is based in UTC. |
| * Use the methods [toLocal] and [toUtc] |
| * to get the equivalent date/time value specified in the other time zone. |
| @@ -199,13 +199,16 @@ class DateTime implements Comparable { |
| * * `"20120227"` |
| * * `"+20120227"` |
| * * `"2012-02-27T14Z"` |
| + * * `"2012-02-27T14+00:00"` |
| * * `"-123450101 00:00:00 Z"`: in the year -12345. |
| */ |
| // TODO(floitsch): specify grammar. |
| static DateTime parse(String formattedString) { |
| final RegExp re = new RegExp( |
| r'^([+-]?\d?\d\d\d\d)-?(\d\d)-?(\d\d)' // The day part. |
| - r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(.\d{1,6})?)?)? ?([zZ])?)?$'); |
| + r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(.\d{1,6})?)?)?' // The time part |
| + r' ?([zZ]|(?:\+00(?::?00)?)?))?$'); // The timezone part |
|
Lasse Reichstein Nielsen
2013/10/29 08:48:45
This seemns to accept a single terminating space (
floitsch
2013/10/30 23:17:34
Done.
|
| + |
| Match match = re.firstMatch(formattedString); |
| if (match != null) { |
| int parseIntOrZero(String matched) { |