Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: pkg/intl/lib/date_format.dart

Issue 14270009: Explain better than the en_US locale is always available, fix other doc glitches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/intl/lib/generate_localized.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/date_format.dart
diff --git a/pkg/intl/lib/date_format.dart b/pkg/intl/lib/date_format.dart
index 88b54d66433ceba4e0038cfe658d2f9174591637..bfc9244a64d2b7c77a51bdefa62e297d726dc542 100644
--- a/pkg/intl/lib/date_format.dart
+++ b/pkg/intl/lib/date_format.dart
@@ -16,11 +16,14 @@ part of intl;
* date-time strings under certain locales. Date elements that vary across
* locales include month name, weekname, field, order, etc.
*
- * The actual date for the locales must be obtained. This can currently be done
- * in one of three ways, determined by which library you import. If you only
- * want to use en_US formatting you can use it directly, as a copy of that
- * locale is hard-coded into the formatter. In all other cases,
- * the [initializeDateFormatting] method must be called and will return a future
+ * Formatting dates in the default "en_US" format does not require any
+ * initialization. e.g.
+ * print(new DateFormat.yMMMd().format(new Date.now()));
+ *
+ * But for other locales, the formatting data for the locale must be
+ * obtained. This can currently be done
+ * in one of three ways, determined by which library you import. In all cases,
+ * the "initializeDateFormatting" method must be called and will return a future
* that is complete once the locale data is available. The result of the future
* isn't important, but the data for that locale is available to the date
* formatting and parsing once it completes.
@@ -28,7 +31,7 @@ part of intl;
* The easiest option is that the data may be available locally, imported in a
* library that contains data for all the locales.
* import 'package:intl/date_symbol_data_local.dart';
- * initializeDateFormatting("en_US", null).then((_) => runMyCode());
+ * initializeDateFormatting("fr_FR", null).then((_) => runMyCode());
*
* If we are running outside of a browser, we may want to read the data
* from files in the file system.
@@ -473,7 +476,7 @@ class DateFormat {
* A series of regular expressions used to parse a format string into its
* component fields.
*/
- static List<Pattern> _matchers = [
+ static List<RegExp> _matchers = [
// Quoted String - anything between single quotes, with escaping
// of single quotes by doubling them.
// e.g. in the pattern "hh 'o''clock'" will match 'o''clock'
« no previous file with comments | « no previous file | pkg/intl/lib/generate_localized.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698