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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 DateFormat jmz() => addPattern("jmz"); | 396 DateFormat jmz() => addPattern("jmz"); |
397 DateFormat jv() => addPattern("jv"); | 397 DateFormat jv() => addPattern("jv"); |
398 DateFormat jz() => addPattern("jz"); | 398 DateFormat jz() => addPattern("jz"); |
399 DateFormat m() => addPattern("m"); | 399 DateFormat m() => addPattern("m"); |
400 DateFormat ms() => addPattern("ms"); | 400 DateFormat ms() => addPattern("ms"); |
401 DateFormat s() => addPattern("s"); | 401 DateFormat s() => addPattern("s"); |
402 | 402 |
403 /** | 403 /** |
404 * ICU constants for format names, resolving to the corresponding skeletons. | 404 * ICU constants for format names, resolving to the corresponding skeletons. |
405 */ | 405 */ |
406 static final String DAY = 'd'; | 406 static const String DAY = 'd'; |
407 static final String ABBR_WEEKDAY = 'E'; | 407 static const String ABBR_WEEKDAY = 'E'; |
408 static final String WEEKDAY = 'EEEE'; | 408 static const String WEEKDAY = 'EEEE'; |
409 static final String ABBR_STANDALONE_MONTH = 'LLL'; | 409 static const String ABBR_STANDALONE_MONTH = 'LLL'; |
410 static final String STANDALONE_MONTH = 'LLLL'; | 410 static const String STANDALONE_MONTH = 'LLLL'; |
411 static final String NUM_MONTH = 'M'; | 411 static const String NUM_MONTH = 'M'; |
412 static final String NUM_MONTH_DAY = 'Md'; | 412 static const String NUM_MONTH_DAY = 'Md'; |
413 static final String NUM_MONTH_WEEKDAY_DAY = 'MEd'; | 413 static const String NUM_MONTH_WEEKDAY_DAY = 'MEd'; |
414 static final String ABBR_MONTH = 'MMM'; | 414 static const String ABBR_MONTH = 'MMM'; |
415 static final String ABBR_MONTH_DAY = 'MMMd'; | 415 static const String ABBR_MONTH_DAY = 'MMMd'; |
416 static final String ABBR_MONTH_WEEKDAY_DAY = 'MMMEd'; | 416 static const String ABBR_MONTH_WEEKDAY_DAY = 'MMMEd'; |
417 static final String MONTH = 'MMMM'; | 417 static const String MONTH = 'MMMM'; |
418 static final String MONTH_DAY = 'MMMMd'; | 418 static const String MONTH_DAY = 'MMMMd'; |
419 static final String MONTH_WEEKDAY_DAY = 'MMMMEEEEd'; | 419 static const String MONTH_WEEKDAY_DAY = 'MMMMEEEEd'; |
420 static final String ABBR_QUARTER = 'QQQ'; | 420 static const String ABBR_QUARTER = 'QQQ'; |
421 static final String QUARTER = 'QQQQ'; | 421 static const String QUARTER = 'QQQQ'; |
422 static final String YEAR = 'y'; | 422 static const String YEAR = 'y'; |
423 static final String YEAR_NUM_MONTH = 'yM'; | 423 static const String YEAR_NUM_MONTH = 'yM'; |
424 static final String YEAR_NUM_MONTH_DAY = 'yMd'; | 424 static const String YEAR_NUM_MONTH_DAY = 'yMd'; |
425 static final String YEAR_NUM_MONTH_WEEKDAY_DAY = 'yMEd'; | 425 static const String YEAR_NUM_MONTH_WEEKDAY_DAY = 'yMEd'; |
426 static final String YEAR_ABBR_MONTH = 'yMMM'; | 426 static const String YEAR_ABBR_MONTH = 'yMMM'; |
427 static final String YEAR_ABBR_MONTH_DAY = 'yMMMd'; | 427 static const String YEAR_ABBR_MONTH_DAY = 'yMMMd'; |
428 static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = 'yMMMEd'; | 428 static const String YEAR_ABBR_MONTH_WEEKDAY_DAY = 'yMMMEd'; |
429 static final String YEAR_MONTH = 'yMMMM'; | 429 static const String YEAR_MONTH = 'yMMMM'; |
430 static final String YEAR_MONTH_DAY = 'yMMMMd'; | 430 static const String YEAR_MONTH_DAY = 'yMMMMd'; |
431 static final String YEAR_MONTH_WEEKDAY_DAY = 'yMMMMEEEEd'; | 431 static const String YEAR_MONTH_WEEKDAY_DAY = 'yMMMMEEEEd'; |
432 static final String YEAR_ABBR_QUARTER = 'yQQQ'; | 432 static const String YEAR_ABBR_QUARTER = 'yQQQ'; |
433 static final String YEAR_QUARTER = 'yQQQQ'; | 433 static const String YEAR_QUARTER = 'yQQQQ'; |
434 static final String HOUR24 = 'H'; | 434 static const String HOUR24 = 'H'; |
435 static final String HOUR24_MINUTE = 'Hm'; | 435 static const String HOUR24_MINUTE = 'Hm'; |
436 static final String HOUR24_MINUTE_SECOND = 'Hms'; | 436 static const String HOUR24_MINUTE_SECOND = 'Hms'; |
437 static final String HOUR = 'j'; | 437 static const String HOUR = 'j'; |
438 static final String HOUR_MINUTE = 'jm'; | 438 static const String HOUR_MINUTE = 'jm'; |
439 static final String HOUR_MINUTE_SECOND = 'jms'; | 439 static const String HOUR_MINUTE_SECOND = 'jms'; |
440 static final String HOUR_MINUTE_GENERIC_TZ = 'jmv'; | 440 static const String HOUR_MINUTE_GENERIC_TZ = 'jmv'; |
441 static final String HOUR_MINUTE_TZ = 'jmz'; | 441 static const String HOUR_MINUTE_TZ = 'jmz'; |
442 static final String HOUR_GENERIC_TZ = 'jv'; | 442 static const String HOUR_GENERIC_TZ = 'jv'; |
443 static final String HOUR_TZ = 'jz'; | 443 static const String HOUR_TZ = 'jz'; |
444 static final String MINUTE = 'm'; | 444 static const String MINUTE = 'm'; |
445 static final String MINUTE_SECOND = 'ms'; | 445 static const String MINUTE_SECOND = 'ms'; |
446 static final String SECOND = 's'; | 446 static const String SECOND = 's'; |
447 | 447 |
448 /** The locale in which we operate, e.g. 'en_US', or 'pt'. */ | 448 /** The locale in which we operate, e.g. 'en_US', or 'pt'. */ |
449 String _locale; | 449 String _locale; |
450 | 450 |
451 /** | 451 /** |
452 * The full template string. This may have been specified directly, or | 452 * The full template string. This may have been specified directly, or |
453 * it may have been derived from a skeleton and the locale information | 453 * it may have been derived from a skeleton and the locale information |
454 * on how to interpret that skeleton. | 454 * on how to interpret that skeleton. |
455 */ | 455 */ |
456 String _pattern; | 456 String _pattern; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 List _reverse(List list) { | 592 List _reverse(List list) { |
593 // TODO(alanknight): Use standardized list reverse when implemented. | 593 // TODO(alanknight): Use standardized list reverse when implemented. |
594 // See Issue 2804. | 594 // See Issue 2804. |
595 var result = new List(); | 595 var result = new List(); |
596 for (var i = list.length-1; i >= 0; i--) { | 596 for (var i = list.length-1; i >= 0; i--) { |
597 result.addLast(list[i]); | 597 result.addLast(list[i]); |
598 } | 598 } |
599 return result; | 599 return result; |
600 } | 600 } |
601 } | 601 } |
OLD | NEW |