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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 * century. Any other numeric string, such as a one digit string, a three or | 149 * century. Any other numeric string, such as a one digit string, a three or |
150 * more digit string will be interpreted as its face value. | 150 * more digit string will be interpreted as its face value. |
151 * | 151 * |
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'); |
| 160 |
159 #import('intl.dart'); | 161 #import('intl.dart'); |
160 #import('date_time_patterns.dart'); | 162 #import('date_time_patterns.dart'); |
161 #import('date_symbols.dart'); | 163 #import('date_symbols.dart'); |
162 #import('date_symbol_data.dart'); | 164 #import('date_symbol_data.dart'); |
163 | 165 |
164 #source('lib/date_format_field.dart'); | 166 #source('lib/date_format_field.dart'); |
165 #source('lib/date_format_helpers.dart'); | 167 #source('lib/date_format_helpers.dart'); |
166 | 168 |
167 class DateFormat { | 169 class DateFormat { |
168 | 170 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 /** Polyfill for missing library function. */ | 591 /** Polyfill for missing library function. */ |
590 List _reverse(List list) { | 592 List _reverse(List list) { |
591 // TODO(alanknight): Use standardized list reverse when implemented. | 593 // TODO(alanknight): Use standardized list reverse when implemented. |
592 // See Issue 2804. | 594 // See Issue 2804. |
593 var result = new List(); | 595 var result = new List(); |
594 for (var i = list.length-1; i >= 0; i--) { | 596 for (var i = list.length-1; i >= 0; i--) { |
595 result.addLast(list[i]); | 597 result.addLast(list[i]); |
596 } | 598 } |
597 return result; | 599 return result; |
598 } | 600 } |
599 } | 601 } |
OLD | NEW |