| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * This contains internal implementation details of the date formatting code | 6 * This contains internal implementation details of the date formatting code |
| 7 * which are exposed as public functions because they must be called by other | 7 * which are exposed as public functions because they must be called by other |
| 8 * libraries in order to configure the source for the locale data. We don't want | 8 * libraries in order to configure the source for the locale data. We don't want |
| 9 * them exposed as public API functions in the date formatting library, so they | 9 * them exposed as public API functions in the date formatting library, so they |
| 10 * are put in a separate library here. These are for internal use only. User | 10 * are put in a separate library here. These are for internal use only. User |
| 11 * code should import one of the `date_symbol_data...` libraries and call the | 11 * code should import one of the `date_symbol_data...` libraries and call the |
| 12 * `initializeDateFormatting` method exposed there. | 12 * `initializeDateFormatting` method exposed there. |
| 13 */ | 13 */ |
| 14 | 14 |
| 15 library date_format_internal; | 15 #library('date_format_internal'); |
| 16 import 'intl_helpers.dart'; | 16 #import('intl_helpers.dart'); |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * This holds the symbols to be used for date/time formatting, indexed | 19 * This holds the symbols to be used for date/time formatting, indexed |
| 20 * by locale. Note that it will be set differently during initialization, | 20 * by locale. Note that it will be set differently during initialization, |
| 21 * depending on what implementation we are using. By default, it is initialized | 21 * depending on what implementation we are using. By default, it is initialized |
| 22 * to an instance of UninitializedLocaleData, so any attempt to use it will | 22 * to an instance of UninitializedLocaleData, so any attempt to use it will |
| 23 * result in an informative error message. | 23 * result in an informative error message. |
| 24 */ | 24 */ |
| 25 var dateTimeSymbols = | 25 var dateTimeSymbols = |
| 26 const UninitializedLocaleData('initializeDateFormatting(<locale>)'); | 26 const UninitializedLocaleData('initializeDateFormatting(<locale>)'); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 55 */ | 55 */ |
| 56 void initializeDatePatterns(Function patterns) { | 56 void initializeDatePatterns(Function patterns) { |
| 57 if (dateTimePatterns is UninitializedLocaleData) { | 57 if (dateTimePatterns is UninitializedLocaleData) { |
| 58 dateTimePatterns = patterns(); | 58 dateTimePatterns = patterns(); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 Future initializeIndividualLocaleDateFormatting(Function init) { | 62 Future initializeIndividualLocaleDateFormatting(Function init) { |
| 63 return init(dateTimeSymbols, dateTimePatterns); | 63 return init(dateTimeSymbols, dateTimePatterns); |
| 64 } | 64 } |
| OLD | NEW |