| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 * If the year pattern does not have exactly two 'y' characters, the year is | 152 * If the year pattern does not have exactly two 'y' characters, the year is |
| 153 * interpreted literally, regardless of the number of digits. So using the | 153 * interpreted literally, regardless of the number of digits. So using the |
| 154 * pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D. | 154 * pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D. |
| 155 */ | 155 */ |
| 156 | 156 |
| 157 #library('date_format'); | 157 #library('date_format'); |
| 158 | 158 |
| 159 #import('dart:math'); | 159 #import('dart:math'); |
| 160 #import('intl.dart'); | 160 #import('intl.dart'); |
| 161 #import('date_symbols.dart'); | 161 #import('date_symbols.dart'); |
| 162 #import('lib/intl_helpers.dart'); | 162 #import('src/intl_helpers.dart'); |
| 163 #import('lib/date_format_internal.dart'); | 163 #import('src/date_format_internal.dart'); |
| 164 | 164 |
| 165 #source('lib/date_format_field.dart'); | 165 #source('src/date_format_field.dart'); |
| 166 #source('lib/date_format_helpers.dart'); | 166 #source('src/date_format_helpers.dart'); |
| 167 | 167 |
| 168 class DateFormat { | 168 class DateFormat { |
| 169 | 169 |
| 170 /** | 170 /** |
| 171 * If [newPattern] matches one of the skeleton forms, it is looked up | 171 * If [newPattern] matches one of the skeleton forms, it is looked up |
| 172 * in [locale] or in the default if none is specified, and the corresponding | 172 * in [locale] or in the default if none is specified, and the corresponding |
| 173 * full format string is used. If [newPattern] does not match one | 173 * full format string is used. If [newPattern] does not match one |
| 174 * of the supported skeleton forms then it is used as a format directly. | 174 * of the supported skeleton forms then it is used as a format directly. |
| 175 * | 175 * |
| 176 * For example, in an en_US locale, specifying the skeleton | 176 * For example, in an en_US locale, specifying the skeleton |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 List _reverse(List list) { | 547 List _reverse(List list) { |
| 548 // TODO(alanknight): Use standardized list reverse when implemented. | 548 // TODO(alanknight): Use standardized list reverse when implemented. |
| 549 // See Issue 2804. | 549 // See Issue 2804. |
| 550 var result = new List(); | 550 var result = new List(); |
| 551 for (var i = list.length-1; i >= 0; i--) { | 551 for (var i = list.length-1; i >= 0; i--) { |
| 552 result.addLast(list[i]); | 552 result.addLast(list[i]); |
| 553 } | 553 } |
| 554 return result; | 554 return result; |
| 555 } | 555 } |
| 556 } | 556 } |
| OLD | NEW |