| 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; |
| 6 |
| 5 /** | 7 /** |
| 6 * This is a private class internal to DateFormat which is used for formatting | 8 * This is a private class internal to DateFormat which is used for formatting |
| 7 * particular fields in a template. e.g. if the format is hh:mm:ss then the | 9 * particular fields in a template. e.g. if the format is hh:mm:ss then the |
| 8 * fields would be "hh", ":", "mm", ":", and "ss". Each type of field knows | 10 * fields would be "hh", ":", "mm", ":", and "ss". Each type of field knows |
| 9 * how to format that portion of a date. | 11 * how to format that portion of a date. |
| 10 */ | 12 */ |
| 11 abstract class _DateFormatField { | 13 abstract class _DateFormatField { |
| 12 /** The format string that defines us, e.g. "hh" */ | 14 /** The format string that defines us, e.g. "hh" */ |
| 13 String pattern; | 15 String pattern; |
| 14 | 16 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 var basicString = toBePrinted.toString(); | 397 var basicString = toBePrinted.toString(); |
| 396 if (basicString.length >= width) return basicString; | 398 if (basicString.length >= width) return basicString; |
| 397 var buffer = new StringBuffer(); | 399 var buffer = new StringBuffer(); |
| 398 for (var i = 0; i < width - basicString.length; i++) { | 400 for (var i = 0; i < width - basicString.length; i++) { |
| 399 buffer.add('0'); | 401 buffer.add('0'); |
| 400 } | 402 } |
| 401 buffer.add(basicString); | 403 buffer.add(basicString); |
| 402 return buffer.toString(); | 404 return buffer.toString(); |
| 403 } | 405 } |
| 404 } | 406 } |
| OLD | NEW |