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 * DateFormat is for formatting and parsing dates in a locale-sensitive | 6 * DateFormat is for formatting and parsing dates in a locale-sensitive |
7 * manner. | 7 * manner. |
8 * It allows the user to choose from a set of standard date time formats as well | 8 * It allows the user to choose from a set of standard date time formats as well |
9 * as specify a customized pattern under certain locales. Date elements that | 9 * as specify a customized pattern under certain locales. Date elements that |
10 * vary across locales include month name, week name, field order, etc. | 10 * vary across locales include month name, week name, field order, etc. |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 /** | 243 /** |
244 * Return the locale code in which we operate, e.g. 'en_US' or 'pt'. | 244 * Return the locale code in which we operate, e.g. 'en_US' or 'pt'. |
245 */ | 245 */ |
246 String get locale => _locale; | 246 String get locale => _locale; |
247 | 247 |
248 /** | 248 /** |
249 * Returns a list of all locales for which we have date formatting | 249 * Returns a list of all locales for which we have date formatting |
250 * information. | 250 * information. |
251 */ | 251 */ |
252 static List<String> allLocalesWithSymbols() => dateTimeSymbols.getKeys(); | 252 static List<String> allLocalesWithSymbols() => dateTimeSymbols.keys; |
253 | 253 |
254 /** | 254 /** |
255 * The named constructors for this class are all conveniences for creating | 255 * The named constructors for this class are all conveniences for creating |
256 * instances using one of the known "skeleton" formats, and having code | 256 * instances using one of the known "skeleton" formats, and having code |
257 * completion support for discovering those formats. | 257 * completion support for discovering those formats. |
258 * So, | 258 * So, |
259 * new DateFormat.yMd("en_US") | 259 * new DateFormat.yMd("en_US") |
260 * is equivalent to | 260 * is equivalent to |
261 * new DateFormat("yMd", "en_US") | 261 * new DateFormat("yMd", "en_US") |
262 * To create a compound format you can use these constructors in combination | 262 * To create a compound format you can use these constructors in combination |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 List _reverse(List list) { | 559 List _reverse(List list) { |
560 // TODO(alanknight): Use standardized list reverse when implemented. | 560 // TODO(alanknight): Use standardized list reverse when implemented. |
561 // See Issue 2804. | 561 // See Issue 2804. |
562 var result = new List(); | 562 var result = new List(); |
563 for (var i = list.length-1; i >= 0; i--) { | 563 for (var i = list.length-1; i >= 0; i--) { |
564 result.addLast(list[i]); | 564 result.addLast(list[i]); |
565 } | 565 } |
566 return result; | 566 return result; |
567 } | 567 } |
568 } | 568 } |
OLD | NEW |