Parse Eras in dates. Start pushing changes from google repo
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0469e49..02055b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 0.12.5
+ * Parse Eras in DateFormat.
+
## 0.12.4+2
* update analyzer to '<0.27.0'
diff --git a/lib/src/intl/date_format_field.dart b/lib/src/intl/date_format_field.dart
index 8df1154..d09f2c3 100644
--- a/lib/src/intl/date_format_field.dart
+++ b/lib/src/intl/date_format_field.dart
@@ -283,6 +283,7 @@
parseDayOfWeek(input);
break;
case 'G':
+ parseEra(input);
break; // era
case 'h':
parse1To12Hours(input, builder);
@@ -622,6 +623,11 @@
parseEnumeratedString(input, possibilities);
}
+ void parseEra(_Stream input) {
+ var possibilities = width >= 4 ? symbols.ERANAMES : symbols.ERAS;
+ parseEnumeratedString(input, possibilities);
+ }
+
String formatMinutes(DateTime date) {
return padTo(width, date.minute);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 671a788..24bdeea 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: intl
-version: 0.12.4+2
+version: 0.12.5-dev
author: Dart Team <misc@dartlang.org>
description: Contains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.
homepage: https://github.com/dart-lang/intl
diff --git a/test/find_default_locale_browser_test.dart b/test/find_default_locale_browser_test.dart
index f00b4c8..865f86f 100644
--- a/test/find_default_locale_browser_test.dart
+++ b/test/find_default_locale_browser_test.dart
@@ -4,11 +4,14 @@
library find_default_locale_browser_test;
+import 'package:unittest/html_config.dart';
import 'package:intl/intl.dart';
import 'package:intl/intl_browser.dart';
import 'package:unittest/unittest.dart';
main() {
+ useHtmlConfiguration();
+
test("Find system locale in browser", () {
// TODO (alanknight): This only verifies that we found some locale. We
// should find a way to force the system locale before the test is run