Chromium Code Reviews| 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. |
| 11 * <!-- TODO(efortuna): Customized pattern system -- suggested by i18n needs | 11 * <!-- TODO(efortuna): Customized pattern system -- suggested by i18n needs |
| 12 * feedback on appropriateness. --> | 12 * feedback on appropriateness. --> |
| 13 * We also allow the user to use any customized pattern to parse or format | 13 * We also allow the user to use any customized pattern to parse or format |
| 14 * date-time strings under certain locales. Date elements that vary across | 14 * date-time strings under certain locales. Date elements that vary across |
| 15 * locales include month name, weekname, field, order, etc. | 15 * locales include month name, weekname, field, order, etc. |
| 16 * | 16 * |
| 17 * This library uses the ICU/JDK date/time pattern specification both for | 17 * This library uses the ICU/JDK date/time pattern specification both for |
| 18 * complete format specifications and also the abbreviated "skeleton" form | 18 * complete format specifications and also the abbreviated "skeleton" form |
| 19 * which can also adapt to different locales and is preferred where available. | 19 * which can also adapt to different locales and is preferred where available. |
| 20 * | 20 * |
| 21 * Skeletons: These can be specified either as the ICU constant name or as the | 21 * Skeletons: These can be specified either as the ICU constant name or as the |
| 22 * skeleton to which it resolves. The supported set of skeletons is as follows | 22 * skeleton to which it resolves. The supported set of skeletons is as follows |
| 23 * ICU Name Skeleton | 23 * ICU Name Skeleton |
| 24 * -------- -------- | 24 * -------- -------- |
| 25 * DAY d | 25 * DAY d |
| 26 * ABBR_WEEKDAY E | 26 * ABBR_WEEKDAY E |
| 27 * WEEKDAY EEEE | 27 * WEEKDAY EEEE |
| 28 * ABBR_STANDALONE_MONTH LLL | 28 * ABBR_STANDALONE_MONTH LLL |
| 29 * STANDALONE_MONTH LLLL | 29 * STANDALONE_MONTH LLLL |
| 30 * NUM_MONTH M | 30 * NUM_MONTH M |
| 31 * NUM_MONTH_DAY Md | 31 * NUM_MONTH_DAY Md |
| 32 * NUM_MONTH_WEEKDAY_DAY MEd | 32 * NUM_MONTH_WEEKDAY_DAY MEd |
| 33 * ABBR_MONTH MMM | 33 * ABBR_MONTH MMM |
| 34 * ABBR_MONTH_DAY MMMd | 34 * ABBR_MONTH_DAY MMMd |
| 35 * ABBR_MONTH_WEEKDAY_DAY MMMEd | 35 * ABBR_MONTH_WEEKDAY_DAY MMMEd |
| 36 * MONTH MMMM | 36 * MONTH MMMM |
| 37 * MONTH_DAY MMMMd | 37 * MONTH_DAY MMMMd |
| 38 * MONTH_WEEKDAY_DAY MMMMEEEEd | 38 * MONTH_WEEKDAY_DAY MMMMEEEEd |
| 39 * ABBR_QUARTER QQQ | 39 * ABBR_QUARTER QQQ |
| 40 * QUARTER QQQQ | 40 * QUARTER QQQQ |
| 41 * YEAR y | 41 * YEAR y |
| 42 * YEAR_NUM_MONTH yM | 42 * YEAR_NUM_MONTH yM |
| 43 * YEAR_NUM_MONTH_DAY yMd | 43 * YEAR_NUM_MONTH_DAY yMd |
| 44 * YEAR_NUM_MONTH_WEEKDAY_DAY yMEd | 44 * YEAR_NUM_MONTH_WEEKDAY_DAY yMEd |
| 45 * YEAR_ABBR_MONTH yMMM | 45 * YEAR_ABBR_MONTH yMMM |
| 46 * YEAR_ABBR_MONTH_DAY yMMMd | 46 * YEAR_ABBR_MONTH_DAY yMMMd |
| 47 * YEAR_ABBR_MONTH_WEEKDAY_DAY yMMMEd | 47 * YEAR_ABBR_MONTH_WEEKDAY_DAY yMMMEd |
| 48 * YEAR_MONTH yMMMM | 48 * YEAR_MONTH yMMMM |
| 49 * YEAR_MONTH_DAY yMMMMd | 49 * YEAR_MONTH_DAY yMMMMd |
| 50 * YEAR_MONTH_WEEKDAY_DAY yMMMMEEEEd | 50 * YEAR_MONTH_WEEKDAY_DAY yMMMMEEEEd |
| 51 * YEAR_ABBR_QUARTER yQQQ | 51 * YEAR_ABBR_QUARTER yQQQ |
| 52 * YEAR_QUARTER yQQQQ | 52 * YEAR_QUARTER yQQQQ |
| 53 * HOUR24 H | 53 * HOUR24 H |
| 54 * HOUR24_MINUTE Hm | 54 * HOUR24_MINUTE Hm |
| 55 * HOUR24_MINUTE_SECOND Hms | 55 * HOUR24_MINUTE_SECOND Hms |
| 56 * HOUR j | 56 * HOUR j |
| 57 * HOUR_MINUTE jm | 57 * HOUR_MINUTE jm |
| 58 * HOUR_MINUTE_SECOND jms | 58 * HOUR_MINUTE_SECOND jms |
| 59 * HOUR_MINUTE_GENERIC_TZ jmv | 59 * HOUR_MINUTE_GENERIC_TZ jmv |
| 60 * HOUR_MINUTE_TZ jmz | 60 * HOUR_MINUTE_TZ jmz |
| 61 * HOUR_GENERIC_TZ jv | 61 * HOUR_GENERIC_TZ jv |
| 62 * HOUR_TZ jz | 62 * HOUR_TZ jz |
| 63 * MINUTE m | 63 * MINUTE m |
| 64 * MINUTE_SECOND ms | 64 * MINUTE_SECOND ms |
| 65 * SECOND s | 65 * SECOND s |
| 66 * | 66 * |
| 67 * Examples Using the US Locale: | 67 * Examples Using the US Locale: |
| 68 * | 68 * |
| 69 * Pattern Result | 69 * Pattern Result |
| 70 * ---------------- ------- | 70 * ---------------- ------- |
| 71 * new DateFormat.yMd() -> 07/10/1996 | 71 * new DateFormat.yMd() -> 07/10/1996 |
| 72 * new DateFormat("yMd") -> 07/10/1996 | 72 * new DateFormat("yMd") -> 07/10/1996 |
| 73 * new DateFormat.yMMMMd("en_US") -> July 10, 1996 | 73 * new DateFormat.yMMMMd("en_US") -> July 10, 1996 |
| 74 * new DateFormat("Hm", "en_US") -> 12:08 PM | 74 * new DateFormat("Hm", "en_US") -> 12:08 PM |
| 75 * new DateFormat.yMd().Hm() -> 07/10/1996 12:08 PM | 75 * new DateFormat.yMd().Hm() -> 07/10/1996 12:08 PM |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 98 * k hour in day (1~24) (Number) 24 | 98 * k hour in day (1~24) (Number) 24 |
| 99 * K hour in am/pm (0~11) (Number) 0 | 99 * K hour in am/pm (0~11) (Number) 0 |
| 100 * z time zone (Text) Pacific Standard Time | 100 * z time zone (Text) Pacific Standard Time |
| 101 * Z time zone (RFC 822) (Number) -0800 | 101 * Z time zone (RFC 822) (Number) -0800 |
| 102 * v time zone (generic) (Text) Pacific Time | 102 * v time zone (generic) (Text) Pacific Time |
| 103 * Q quarter (Text) Q3 | 103 * Q quarter (Text) Q3 |
| 104 * ' escape for text (Delimiter) 'Date=' | 104 * ' escape for text (Delimiter) 'Date=' |
| 105 * '' single quote (Literal) 'o''clock' | 105 * '' single quote (Literal) 'o''clock' |
| 106 * | 106 * |
| 107 * The count of pattern letters determine the format. | 107 * The count of pattern letters determine the format. |
| 108 * | |
| 108 * **Text**: | 109 * **Text**: |
| 109 * * 5 pattern letters--use narrow form for standalone. Otherwise does not apply | 110 * * 5 pattern letters--use narrow form for standalone. Otherwise does not apply |
| 110 * * 4 or more pattern letters--use full form, | 111 * * 4 or more pattern letters--use full form, |
| 111 * * 3 pattern letters--use short or abbreviated form if one exists | 112 * * 3 pattern letters--use short or abbreviated form if one exists |
| 112 * * less than 3--use numeric form if one exists | 113 * * less than 3--use numeric form if one exists |
| 113 * | 114 * |
| 114 * **Number**: the minimum number of digits. Shorter numbers are zero-padded to | 115 * **Number**: the minimum number of digits. Shorter numbers are zero-padded to |
| 115 * this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is handled | 116 * this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is handled |
| 116 * specially; that is, if the count of 'y' is 2, the Year will be truncated to | 117 * specially; that is, if the count of 'y' is 2, the Year will be truncated to |
| 117 * 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".) Unlike other | 118 * 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".) Unlike other |
| 118 * fields, fractional seconds are padded on the right with zero. | 119 * fields, fractional seconds are padded on the right with zero. |
| 119 * | 120 * |
| 120 * (Text & Number): 3 or over, use text, otherwise use number. | 121 * **(Text & Number)**: 3 or over, use text, otherwise use number. |
| 121 * | 122 * |
| 122 * Any characters that not in the pattern will be treated as quoted text. For | 123 * Any characters not in the pattern will be treated as quoted text. For |
| 123 * instance, characters like ':', '.', ' ', '#' and '@' will appear in the | 124 * instance, characters like ':', '.', ' ', '#' and '@' will appear in the |
| 124 * resulting time text even they are not embraced within single quotes. In our | 125 * resulting text even though they are not enclosed in single quotes. In our |
| 125 * current pattern usage, we didn't use up all letters. But those unused | 126 * current pattern usage, not all letters have meanings. But those unused |
| 126 * letters are strongly discouraged to be used as quoted text without quote. | 127 * letters are strongly discouraged to be used as quoted text without quotes, |
| 127 * That's because we may use other letter for pattern in future. | 128 * because we may use other letters as pattern characters in the future. |
| 128 * | 129 * |
| 129 * Examples Using the US Locale: | 130 * Examples Using the US Locale: |
| 130 * | 131 * |
| 131 * Format Pattern Result | 132 * Format Pattern Result |
| 132 * -------------- ------- | 133 * -------------- ------- |
| 133 * "yyyy.MM.dd G 'at' HH:mm:ss vvvv"->1996.07.10 AD at 15:08:56 Pacific Time | 134 * "yyyy.MM.dd G 'at' HH:mm:ss vvvv" 1996.07.10 AD at 15:08:56 Pacific Time |
| 134 * "EEE, MMM d, ''yy" ->Wed, July 10, '96 | 135 * "EEE, MMM d, ''yy" Wed, July 10, '96 |
| 135 * "h:mm a" ->12:08 PM | 136 * "h:mm a" 12:08 PM |
| 136 * "hh 'o''clock' a, zzzz" ->12 o'clock PM, Pacific Daylight Time | 137 * "hh 'o''clock' a, zzzz" 12 o'clock PM, Pacific Daylight Time |
| 137 * "K:mm a, vvv" ->0:00 PM, PT | 138 * "K:mm a, vvv" 0:00 PM, PT |
| 138 * "yyyyy.MMMMM.dd GGG hh:mm aaa" ->01996.July.10 AD 12:08 PM | 139 * "yyyyy.MMMMM.dd GGG hh:mm aaa" 01996.July.10 AD 12:08 PM |
| 139 * | 140 * |
| 140 * When parsing a date string using the abbreviated year pattern ("yy"), | 141 * When parsing a date string using the abbreviated year pattern ("yy"), |
| 141 * DateFormat must interpret the abbreviated year relative to some | 142 * DateFormat must interpret the abbreviated year relative to some |
| 142 * century. It does this by adjusting dates to be within 80 years before and 20 | 143 * century. It does this by adjusting dates to be within 80 years before and 20 |
| 143 * years after the time the parse function is called. For example, using a | 144 * years after the time the parse function is called. For example, using a |
| 144 * pattern of "MM/dd/yy" and a DateTimeParse instance created on Jan 1, 1997, | 145 * pattern of "MM/dd/yy" and a DateTimeParse instance created on Jan 1, 1997, |
| 145 * the string "01/11/12" would be interpreted as Jan 11, 2012 while the string | 146 * the string "01/11/12" would be interpreted as Jan 11, 2012 while the string |
| 146 * "05/04/64" would be interpreted as May 4, 1964. During parsing, only | 147 * "05/04/64" would be interpreted as May 4, 1964. During parsing, only |
| 147 * strings consisting of exactly two digits, as defined by {@link | 148 * strings consisting of exactly two digits, as defined by {@link |
| 148 * java.lang.Character#isDigit(char)}, will be parsed into the default | 149 * java.lang.Character#isDigit(char)}, will be parsed into the default |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 161 #import('date_symbols.dart'); | 162 #import('date_symbols.dart'); |
| 162 #import('src/intl_helpers.dart'); | 163 #import('src/intl_helpers.dart'); |
| 163 #import('src/date_format_internal.dart'); | 164 #import('src/date_format_internal.dart'); |
| 164 | 165 |
| 165 #source('src/date_format_field.dart'); | 166 #source('src/date_format_field.dart'); |
| 166 #source('src/date_format_helpers.dart'); | 167 #source('src/date_format_helpers.dart'); |
| 167 | 168 |
| 168 class DateFormat { | 169 class DateFormat { |
| 169 | 170 |
| 170 /** | 171 /** |
| 171 * If [newPattern] matches one of the skeleton forms, it is looked up | 172 * Creates a new DateFormat, using the format specified by [newPattern]. For |
| 172 * in [locale] or in the default if none is specified, and the corresponding | 173 * forms that match one of our predefined skeletons, we look up the |
| 173 * full format string is used. If [newPattern] does not match one | 174 * corresponding pattern in [locale] (or in the default locale if none is |
| 174 * of the supported skeleton forms then it is used as a format directly. | 175 * specified) and use the resulting full format string. This is the |
| 176 * preferred usage, but if [newPattern] does not match one of the skeletons, | |
| 177 * then it is used as a format directly, but will not be adapted to suit | |
| 178 * the locale. | |
| 175 * | 179 * |
| 176 * For example, in an en_US locale, specifying the skeleton | 180 * For example, in an en_US locale, specifying the skeleton |
| 177 * `new DateFormat('yMEd');` | 181 * new DateFormat('yMEd'); |
| 178 * or the explicit | 182 * or the explicit |
| 179 * `new DateFormat('EEE, M/d/y');` | 183 * new DateFormat('EEE, M/d/y'); |
|
Emily Fortuna
2012/10/02 23:44:08
I thought ` denoted code?
Alan Knight
2012/10/02 23:45:33
It didn't seem to. It was coming out with literal
| |
| 180 * would produce the same result, a date of the form | 184 * would produce the same result, a date of the form |
| 181 * `Wed, 6/27/2012` | 185 * Wed, 6/27/2012 |
| 182 * However, the skeleton version would also adapt to other locales. | 186 * The first version would produce a different format string if used in |
| 187 * another locale, but the second format would always be the same. | |
| 183 * | 188 * |
| 184 * If [locale] does not exist in our set of supported locales then an | 189 * If [locale] does not exist in our set of supported locales then an |
| 185 * [ArgumentError] is thrown. | 190 * [ArgumentError] is thrown. |
| 186 */ | 191 */ |
| 187 DateFormat([String newPattern, String locale]) { | 192 DateFormat([String newPattern, String locale]) { |
| 188 // TODO(alanknight): It should be possible to specify multiple skeletons eg | 193 // TODO(alanknight): It should be possible to specify multiple skeletons eg |
| 189 // date, time, timezone all separately. Adding many or named parameters to | 194 // date, time, timezone all separately. Adding many or named parameters to |
| 190 // the constructor seems awkward, especially with the possibility of | 195 // the constructor seems awkward, especially with the possibility of |
| 191 // confusion with the locale. A "fluent" interface with cascading on an | 196 // confusion with the locale. A "fluent" interface with cascading on an |
| 192 // instance might work better? A list of patterns is also possible. | 197 // instance might work better? A list of patterns is also possible. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 */ | 258 */ |
| 254 String get locale => _locale; | 259 String get locale => _locale; |
| 255 | 260 |
| 256 /** | 261 /** |
| 257 * Returns a list of all locales for which we have date formatting | 262 * Returns a list of all locales for which we have date formatting |
| 258 * information. | 263 * information. |
| 259 */ | 264 */ |
| 260 static List<String> allLocalesWithSymbols() => dateTimeSymbols.getKeys(); | 265 static List<String> allLocalesWithSymbols() => dateTimeSymbols.getKeys(); |
| 261 | 266 |
| 262 /** | 267 /** |
| 263 * Constructors for a set of predefined "skeletons" for which the | 268 * The named constructors for this class are all conveniences for creating |
| 264 * internationalized forms are known. These can also be chained | 269 * instances using one of the known "skeleton" formats, and having code |
| 265 * together using the "add_" instance methods below. | 270 * completion support for discovering those formats. |
| 271 * So, | |
| 272 * new DateFormat.yMd("en_US") | |
| 273 * is equivalent to | |
| 274 * new DateFormat("yMd", "en_US") | |
| 275 * To create a compound format you can use these constructors in combination | |
| 276 * with the add_ methods below. e.g. | |
| 277 * new DateFormat.yMd().add_Hms(); | |
| 278 * If the optional [locale] is omitted, the format will be created using the | |
| 279 * default locale in [Intl.systemLocale]. | |
| 266 */ | 280 */ |
| 267 DateFormat.d([locale]) : this("d", locale); | 281 DateFormat.d([locale]) : this("d", locale); |
| 268 DateFormat.E([locale]) : this("E", locale); | 282 DateFormat.E([locale]) : this("E", locale); |
| 269 DateFormat.EEEE([locale]) : this("EEEE", locale); | 283 DateFormat.EEEE([locale]) : this("EEEE", locale); |
| 270 DateFormat.LLL([locale]) : this("LLL", locale); | 284 DateFormat.LLL([locale]) : this("LLL", locale); |
| 271 DateFormat.LLLL([locale]) : this("LLLL", locale); | 285 DateFormat.LLLL([locale]) : this("LLLL", locale); |
| 272 DateFormat.M([locale]) : this("M", locale); | 286 DateFormat.M([locale]) : this("M", locale); |
| 273 DateFormat.Md([locale]) : this("Md", locale); | 287 DateFormat.Md([locale]) : this("Md", locale); |
| 274 DateFormat.MEd([locale]) : this("MEd", locale); | 288 DateFormat.MEd([locale]) : this("MEd", locale); |
| 275 DateFormat.MMM([locale]) : this("MMM", locale); | 289 DateFormat.MMM([locale]) : this("MMM", locale); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 300 DateFormat.jms([locale]) : this("jms", locale); | 314 DateFormat.jms([locale]) : this("jms", locale); |
| 301 DateFormat.jmv([locale]) : this("jmv", locale); | 315 DateFormat.jmv([locale]) : this("jmv", locale); |
| 302 DateFormat.jmz([locale]) : this("jmz", locale); | 316 DateFormat.jmz([locale]) : this("jmz", locale); |
| 303 DateFormat.jv([locale]) : this("jv", locale); | 317 DateFormat.jv([locale]) : this("jv", locale); |
| 304 DateFormat.jz([locale]) : this("jz", locale); | 318 DateFormat.jz([locale]) : this("jz", locale); |
| 305 DateFormat.m([locale]) : this("m", locale); | 319 DateFormat.m([locale]) : this("m", locale); |
| 306 DateFormat.ms([locale]) : this("ms", locale); | 320 DateFormat.ms([locale]) : this("ms", locale); |
| 307 DateFormat.s([locale]) : this("s", locale); | 321 DateFormat.s([locale]) : this("s", locale); |
| 308 | 322 |
| 309 /** | 323 /** |
| 310 * Methods for appending a particular skeleton to the format, or setting | 324 * The "add_*" methods append a particular skeleton to the format, or set |
| 311 * it as the only format if none was previously set. These are primarily | 325 * it as the only format if none was previously set. These are primarily |
| 312 * useful for creating compound formats. For example | 326 * useful for creating compound formats. For example |
| 313 * new DateFormat.yMd().add_hms(); | 327 * new DateFormat.yMd().add_Hms(); |
| 314 * would create a date format that prints both the date and the time. | 328 * would create a date format that prints both the date and the time. |
| 315 */ | 329 */ |
| 316 DateFormat add_d() => addPattern("d"); | 330 DateFormat add_d() => addPattern("d"); |
| 317 DateFormat add_E() => addPattern("E"); | 331 DateFormat add_E() => addPattern("E"); |
| 318 DateFormat add_EEEE() => addPattern("EEEE"); | 332 DateFormat add_EEEE() => addPattern("EEEE"); |
| 319 DateFormat add_LLL() => addPattern("LLL"); | 333 DateFormat add_LLL() => addPattern("LLL"); |
| 320 DateFormat add_LLLL() => addPattern("LLLL"); | 334 DateFormat add_LLLL() => addPattern("LLLL"); |
| 321 DateFormat add_M() => addPattern("M"); | 335 DateFormat add_M() => addPattern("M"); |
| 322 DateFormat add_Md() => addPattern("Md"); | 336 DateFormat add_Md() => addPattern("Md"); |
| 323 DateFormat add_MEd() => addPattern("MEd"); | 337 DateFormat add_MEd() => addPattern("MEd"); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 349 DateFormat add_jms() => addPattern("jms"); | 363 DateFormat add_jms() => addPattern("jms"); |
| 350 DateFormat add_jmv() => addPattern("jmv"); | 364 DateFormat add_jmv() => addPattern("jmv"); |
| 351 DateFormat add_jmz() => addPattern("jmz"); | 365 DateFormat add_jmz() => addPattern("jmz"); |
| 352 DateFormat add_jv() => addPattern("jv"); | 366 DateFormat add_jv() => addPattern("jv"); |
| 353 DateFormat add_jz() => addPattern("jz"); | 367 DateFormat add_jz() => addPattern("jz"); |
| 354 DateFormat add_m() => addPattern("m"); | 368 DateFormat add_m() => addPattern("m"); |
| 355 DateFormat add_ms() => addPattern("ms"); | 369 DateFormat add_ms() => addPattern("ms"); |
| 356 DateFormat add_s() => addPattern("s"); | 370 DateFormat add_s() => addPattern("s"); |
| 357 | 371 |
| 358 /** | 372 /** |
| 359 * ICU constants for format names, resolving to the corresponding skeletons. | 373 * For each of the skeleton formats we also allow the use of the corresponding |
| 374 * ICU constant names. | |
| 360 */ | 375 */ |
| 376 static const String ABBR_MONTH = 'MMM'; | |
| 361 static const String DAY = 'd'; | 377 static const String DAY = 'd'; |
| 362 static const String ABBR_WEEKDAY = 'E'; | 378 static const String ABBR_WEEKDAY = 'E'; |
| 363 static const String WEEKDAY = 'EEEE'; | 379 static const String WEEKDAY = 'EEEE'; |
| 364 static const String ABBR_STANDALONE_MONTH = 'LLL'; | 380 static const String ABBR_STANDALONE_MONTH = 'LLL'; |
| 365 static const String STANDALONE_MONTH = 'LLLL'; | 381 static const String STANDALONE_MONTH = 'LLLL'; |
| 366 static const String NUM_MONTH = 'M'; | 382 static const String NUM_MONTH = 'M'; |
| 367 static const String NUM_MONTH_DAY = 'Md'; | 383 static const String NUM_MONTH_DAY = 'Md'; |
| 368 static const String NUM_MONTH_WEEKDAY_DAY = 'MEd'; | 384 static const String NUM_MONTH_WEEKDAY_DAY = 'MEd'; |
| 369 static const String ABBR_MONTH = 'MMM'; | |
| 370 static const String ABBR_MONTH_DAY = 'MMMd'; | 385 static const String ABBR_MONTH_DAY = 'MMMd'; |
| 371 static const String ABBR_MONTH_WEEKDAY_DAY = 'MMMEd'; | 386 static const String ABBR_MONTH_WEEKDAY_DAY = 'MMMEd'; |
| 372 static const String MONTH = 'MMMM'; | 387 static const String MONTH = 'MMMM'; |
| 373 static const String MONTH_DAY = 'MMMMd'; | 388 static const String MONTH_DAY = 'MMMMd'; |
| 374 static const String MONTH_WEEKDAY_DAY = 'MMMMEEEEd'; | 389 static const String MONTH_WEEKDAY_DAY = 'MMMMEEEEd'; |
| 375 static const String ABBR_QUARTER = 'QQQ'; | 390 static const String ABBR_QUARTER = 'QQQ'; |
| 376 static const String QUARTER = 'QQQQ'; | 391 static const String QUARTER = 'QQQQ'; |
| 377 static const String YEAR = 'y'; | 392 static const String YEAR = 'y'; |
| 378 static const String YEAR_NUM_MONTH = 'yM'; | 393 static const String YEAR_NUM_MONTH = 'yM'; |
| 379 static const String YEAR_NUM_MONTH_DAY = 'yMd'; | 394 static const String YEAR_NUM_MONTH_DAY = 'yMd'; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 List _reverse(List list) { | 562 List _reverse(List list) { |
| 548 // TODO(alanknight): Use standardized list reverse when implemented. | 563 // TODO(alanknight): Use standardized list reverse when implemented. |
| 549 // See Issue 2804. | 564 // See Issue 2804. |
| 550 var result = new List(); | 565 var result = new List(); |
| 551 for (var i = list.length-1; i >= 0; i--) { | 566 for (var i = list.length-1; i >= 0; i--) { |
| 552 result.addLast(list[i]); | 567 result.addLast(list[i]); |
| 553 } | 568 } |
| 554 return result; | 569 return result; |
| 555 } | 570 } |
| 556 } | 571 } |
| OLD | NEW |