| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
| 4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
| 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, weekname, field, order, etc. | 10 * vary across locales include month name, weekname, field, order, etc. |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 * format. | 220 * format. |
| 221 */ | 221 */ |
| 222 String parse(String inputString) { | 222 String parse(String inputString) { |
| 223 return inputString; | 223 return inputString; |
| 224 } | 224 } |
| 225 | 225 |
| 226 /** | 226 /** |
| 227 * Format the given [date] object according to preset pattern and current | 227 * Format the given [date] object according to preset pattern and current |
| 228 * locale and return a formated string for the given date. | 228 * locale and return a formated string for the given date. |
| 229 */ | 229 */ |
| 230 String format(Date date, [TimeZone timeZone]) { | 230 String format(Date date) { |
| 231 // TODO(efortuna): optional TimeZone argument? TimeZone is deprecated... | 231 // TODO(efortuna): readd optional TimeZone argument (or similar)? |
| 232 return date.toString(); | 232 return date.toString(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 /** | 235 /** |
| 236 * Returns a date string indicating how long ago (3 hours, 2 minutes) | 236 * Returns a date string indicating how long ago (3 hours, 2 minutes) |
| 237 * something has happened or how long in the future something will happen | 237 * something has happened or how long in the future something will happen |
| 238 * given a [reference] Date relative to the current time. | 238 * given a [reference] Date relative to the current time. |
| 239 */ | 239 */ |
| 240 String formatDuration(Date reference) { | 240 String formatDuration(Date reference) { |
| 241 return ''; | 241 return ''; |
| 242 } | 242 } |
| 243 | 243 |
| 244 /** | 244 /** |
| 245 * Formats a String indicating how long ago (negative [duration]) or how far | 245 * Formats a String indicating how long ago (negative [duration]) or how far |
| 246 * in the future (positive [duration]) some time is with respect to a | 246 * in the future (positive [duration]) some time is with respect to a |
| 247 * reference [date]. The [duration] is expressed in miliseconds. | 247 * reference [date]. The [duration] is expressed in miliseconds. |
| 248 */ | 248 */ |
| 249 String formatDurationFrom(num duration, Date date) { | 249 String formatDurationFrom(num duration, Date date) { |
| 250 return ''; | 250 return ''; |
| 251 } | 251 } |
| 252 } | 252 } |
| OLD | NEW |