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

Unified Diff: README.md

Issue 1232003005: Fix error in example for printing dates, clarify comments in general (Closed) Base URL: https://github.com/dart-lang/intl.git@master
Patch Set: Created 5 years, 5 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 | lib/src/intl/date_format.dart » ('j') | lib/src/intl/date_format.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: README.md
diff --git a/README.md b/README.md
index 2f789a2acbf793aadb450289fdbb2ff90d72b649..142c6dd817408c1c781059d9b22f4daeaff92a47 100644
--- a/README.md
+++ b/README.md
@@ -39,12 +39,21 @@ the [withLocale][withLocale] operation may be preferable to setting
Intl.withLocale('fr', () => print(myLocalizedMessage());
To specify the locale for an operation you can create a format object in
-a specific locale, or pass in the locale as a parameter to methods.
+a specific locale, pass in the locale as a parameter to methods, or
+set the default locale.
var format = new DateFormat.yMd("ar");
kevmoo 2015/07/10 23:31:03 consider using ```dart void noNeedToIndent() {} `
Alan Knight 2015/07/11 00:07:34 Done.
var dateString = format.format(new DateTime.now());
+
+or
+
print(myMessage(dateString, locale: 'ar');
+or
+
+ Intl.defaultLocale = "es"'
+ new DateFormat.jm().format(new DateTime.now());
+
## Initialization
All the different types of locale data require an async initialization step
« no previous file with comments | « no previous file | lib/src/intl/date_format.dart » ('j') | lib/src/intl/date_format.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698