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

Side by Side Diff: pkg/intl/lib/date_format_internal.dart

Issue 10917069: Async initialization for DateFormat (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * This contains internal implementation details of the date formatting code
7 * which are split out into a separate library because they require public
Emily Fortuna 2012/09/04 20:14:42 "split out into separate libraries"?
Alan Knight 2012/09/04 23:39:03 I don't think so. The methods (plural) are split o
8 * functions (called across library boundaries) which are not part of a
9 * public API.
10 */
11
12 #library('date_format_internal');
13 #import('intl_helpers.dart');
14
15 /**
16 * This holds the symbols to be used for date/time formatting, indexed
17 * by locale. Note that it will be set differently during initialization,
18 * depending on what implementation we are using. By default, it is initialized
19 * to an instance of UninitializedLocaleData, so any attempt to use it will
20 * result in an informative error message.
21 */
22 var dateTimeSymbols =
23 const UninitializedLocaleData('initializeDateFormatting(<locale>)');
24
25 /**
26 * This holds the patterns used for date/time formatting, indexed
27 * by locale. Note that it will be set differently during initialization,
28 * depending on what implementation we are using. By default, it is initialized
29 * to an instance of UninitializedLocaleData, so any attempt to use it will
30 * result in an informative error message.
31 */
32 var dateTimePatterns =
33 const UninitializedLocaleData('initializeDateFormatting(<locale>)');
34
35 /**
36 * Initialize the symbols dictionary.
Emily Fortuna 2012/09/04 20:14:42 Can you explain here how "symbols" is expected to
Alan Knight 2012/09/04 23:39:03 Done.
37 */
38 void initializeDateSymbols(Function symbols) {
39 if (dateTimeSymbols is UninitializedLocaleData) {
40 dateTimeSymbols = symbols();
41 }
42 }
43
44 /// Initialize the patterns dictionary.
Emily Fortuna 2012/09/04 20:14:42 For sake of consistency, make this comment in the
Alan Knight 2012/09/04 23:39:03 Done.
45 void initializeDatePatterns(Function patterns) {
46 if (dateTimePatterns is UninitializedLocaleData) {
47 dateTimePatterns = patterns();
48 }
49 }
50
51 /**
Emily Fortuna 2012/09/04 20:14:42 Either add a comment here or remove the comment no
Alan Knight 2012/09/04 23:39:03 Done.
52 */
53 Future initializeIndividualLocaleDateFormatting(Function init) {
54 return init(dateTimeSymbols, dateTimePatterns);
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698