Chromium Code Reviews| Index: lib/i18n/date_format.dart |
| diff --git a/lib/i18n/date_format.dart b/lib/i18n/date_format.dart |
| index 447ec9c47505ae51a7215d08857cea2e60355146..7ba66c33f5869aaf435e43f4e1d72a9b328512b9 100644 |
| --- a/lib/i18n/date_format.dart |
| +++ b/lib/i18n/date_format.dart |
| @@ -125,8 +125,6 @@ class DateFormat { |
| /** |
| * Named constructors for each of the above values. |
| - * These could probably be made shorter if we just set the format to the |
| - * constant and the parsing was lazy. |
| */ |
| DateFormat.fullDate() : this.formatDefinition = _fullDate; |
| DateFormat.longDate() : this.formatDefinition = _longDate; |
| @@ -140,8 +138,18 @@ class DateFormat { |
| DateFormat.longDateTime() : this.formatDefinition = _longDateTime; |
| DateFormat.mediumDateTime() : this.formatDefinition = _mediumDateTime; |
| DateFormat.shortDateTime() : this.formatDefinition = _shortDateTime; |
| - |
| + |
| + /** |
| + * Explicit constructor given a particular format |
| + */ |
| DateFormat(this.formatDefinition); |
| + |
| + /** |
| + * Constructors for dates/times that use a default format. |
| + */ |
| + DateFormat.date() {formatDefinition = _fullDate;} |
|
Emily Fortuna
2012/06/05 17:40:09
change these to use the initializer list syntax:
D
Alan Knight
2012/06/05 21:47:34
Done.
|
| + DateFormat.time() {formatDefinition = _fullTime;} |
| + DateFormat.dateTime() {formatDefinition = _fullDateTime;} |
| /** |
| * |