| 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 part of intl; | 5 part of intl; |
| 6 | 6 |
| 7 // TODO(efortuna): Customized pattern system -- suggested by i18n needs | 7 // TODO(efortuna): Customized pattern system -- suggested by i18n needs |
| 8 // feedback on appropriateness. | 8 // feedback on appropriateness. |
| 9 /** | 9 /** |
| 10 * DateFormat is for formatting and parsing dates in a locale-sensitive | 10 * DateFormat is for formatting and parsing dates in a locale-sensitive |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 * HOUR_GENERIC_TZ jv | 94 * HOUR_GENERIC_TZ jv |
| 95 * HOUR_TZ jz | 95 * HOUR_TZ jz |
| 96 * MINUTE m | 96 * MINUTE m |
| 97 * MINUTE_SECOND ms | 97 * MINUTE_SECOND ms |
| 98 * SECOND s | 98 * SECOND s |
| 99 * | 99 * |
| 100 * Examples Using the US Locale: | 100 * Examples Using the US Locale: |
| 101 * | 101 * |
| 102 * Pattern Result | 102 * Pattern Result |
| 103 * ---------------- ------- | 103 * ---------------- ------- |
| 104 * new DateFormat.yMd() -> 07/10/1996 | 104 * new DateFormat.yMd() -> 7/10/1996 |
| 105 * new DateFormat("yMd") -> 07/10/1996 | 105 * new DateFormat("yMd") -> 7/10/1996 |
| 106 * new DateFormat.yMMMMd("en_US") -> July 10, 1996 | 106 * new DateFormat.yMMMMd("en_US") -> July 10, 1996 |
| 107 * new DateFormat("Hm", "en_US") -> 12:08 PM | 107 * new DateFormat("Hm", "en_US") -> 12:08 PM |
| 108 * new DateFormat.yMd().add_Hm() -> 07/10/1996 12:08 PM | 108 * new DateFormat.yMd().add_Hm() -> 7/10/1996 12:08 PM |
| 109 * | 109 * |
| 110 * Explicit Pattern Syntax: Formats can also be specified with a pattern string. | 110 * Explicit Pattern Syntax: Formats can also be specified with a pattern string. |
| 111 * The skeleton forms will resolve to explicit patterns of this form, but will | 111 * The skeleton forms will resolve to explicit patterns of this form, but will |
| 112 * also adapt to different patterns in different locales. | 112 * also adapt to different patterns in different locales. |
| 113 * The following characters are reserved: | 113 * The following characters are reserved: |
| 114 * | 114 * |
| 115 * Symbol Meaning Presentation Example | 115 * Symbol Meaning Presentation Example |
| 116 * ------ ------- ------------ ------- | 116 * ------ ------- ------------ ------- |
| 117 * G era designator (Text) AD | 117 * G era designator (Text) AD |
| 118 * y year (Number) 1996 | 118 * y year (Number) 1996 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 _DateFormatField _match(String pattern) { | 581 _DateFormatField _match(String pattern) { |
| 582 for (var i = 0; i < _matchers.length; i++) { | 582 for (var i = 0; i < _matchers.length; i++) { |
| 583 var regex = _matchers[i]; | 583 var regex = _matchers[i]; |
| 584 var match = regex.firstMatch(pattern); | 584 var match = regex.firstMatch(pattern); |
| 585 if (match != null) { | 585 if (match != null) { |
| 586 return _fieldConstructors[i](match.group(0), this); | 586 return _fieldConstructors[i](match.group(0), this); |
| 587 } | 587 } |
| 588 } | 588 } |
| 589 } | 589 } |
| 590 } | 590 } |
| OLD | NEW |