Add custom initialization of DateTime symbols/patterns

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172142246
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc3cf52..3c7304c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@
  * Use locale digits for printing DateTime. This can also be disabled for a
    particular locale use useNativeDigitsByDefaultFor or for a particular
    DateFormat instance use useNativeDigits.
+ * Provide a library for custom-initialized DateTime and number formatting. This
+   allows easier custom locales and synchronous initialization.
 
 ## 0.15.1
  * Use the platform.locale API to get the OS platform.
diff --git a/lib/date_symbol_data_custom.dart b/lib/date_symbol_data_custom.dart
new file mode 100644
index 0000000..67ad522
--- /dev/null
+++ b/lib/date_symbol_data_custom.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2017, the Dart project authors.
+// Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code
+// is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// API to allow setting Date/Time formatting in a custom way.
+///
+/// It does not actually provide any data - that's left to the user of the API.
+import "date_symbols.dart";
+import "src/date_format_internal.dart";
+
+/// This should be called for at least one [locale] before any date
+/// formatting methods are called.
+///
+/// It sets up the lookup for date information. The [symbols] argument should
+/// contain a populated [DateSymbols], and [patterns] should contain a Map for
+/// the same locale from skeletons to the specific format strings. For examples,
+/// see date_time_patterns.dart.
+///
+/// If data for this locale has already been initialized it will be overwritten.
+void initializeDateFormattingCustom(
+    {String locale, DateSymbols symbols, Map<String, String> patterns}) {
+  initializeDateSymbols(_emptySymbols);
+  initializeDatePatterns(_emptyPatterns);
+  if (symbols == null)
+    throw new ArgumentError("Missing DateTime formatting symbols");
+  if (patterns == null)
+    throw new ArgumentError("Missing DateTime formatting patterns");
+  if (locale != symbols.NAME)
+    throw new ArgumentError.value(
+        [locale, symbols.NAME], "Locale does not match symbols.NAME");
+  dateTimeSymbols[symbols.NAME] = symbols;
+  dateTimePatterns[symbols.NAME] = patterns;
+}
+
+Map<String, DateSymbols> _emptySymbols() => {};
+Map<String, Map<String, String>> _emptyPatterns() => {};
diff --git a/test/date_time_format_custom_test.dart b/test/date_time_format_custom_test.dart
new file mode 100644
index 0000000..cdcd638
--- /dev/null
+++ b/test/date_time_format_custom_test.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Test date formatting and parsing using custom locale data, which we get
+/// from the local copy.
+
+import 'dart:async';
+import 'date_time_format_test_stub.dart';
+import 'package:intl/date_symbol_data_local.dart' as localSymbols;
+import 'package:intl/date_time_patterns.dart' as localPatterns;
+import 'package:intl/date_symbol_data_custom.dart';
+
+main() {
+  var symbols = localSymbols.dateTimeSymbolMap();
+  var patterns = localPatterns.dateTimePatternMap();
+  List<String> locales = symbols.keys.toList().take(10).toList();
+  // Force inclusion of locales that are hard-coded in tests.
+  var requiredLocales = ["en_US", "de", "fr", "ja", "el", "de_AT"];
+  locales.addAll(requiredLocales);
+  for (var locale in locales) {
+    print("initializing $locale");
+    initializeDateFormattingCustom(
+        locale: locale, symbols: symbols[locale], patterns: patterns[locale]);
+  }
+  runWith(() => locales, null, nullInitialization);
+}
+
+Future nullInitialization(String a, String b) => new Future.value(null);