Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart core library. | 5 // Dart core library. |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Date is the public interface to a point in time. | 8 * Date is the public interface to a point in time. |
| 9 * | 9 * |
| 10 * It can represent time values that are at a distance of at most | 10 * It can represent time values that are at a distance of at most |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 /** | 41 /** |
| 42 * Constructs a [Date] instance based on the individual parts. The date is | 42 * Constructs a [Date] instance based on the individual parts. The date is |
| 43 * in the local time zone if [isUtc] is false. | 43 * in the local time zone if [isUtc] is false. |
| 44 * | 44 * |
| 45 * [month] and [day] are one-based. For example | 45 * [month] and [day] are one-based. For example |
| 46 * [:new Date(1938, 1, 10)] represents the 10th of January 1938. | 46 * [:new Date(1938, 1, 10)] represents the 10th of January 1938. |
| 47 */ | 47 */ |
| 48 // TODO(floitsch): the spec allows default values in interfaces, but our | 48 // TODO(floitsch): the spec allows default values in interfaces, but our |
| 49 // tools don't yet. Eventually we want to have default values here. | 49 // tools don't yet. Eventually we want to have default values here. |
| 50 Date(int year, | 50 Date(int year, |
| 51 [int month, | 51 [int month = 1, |
|
Mads Ager (google)
2012/09/17 05:52:56
Are default values allowed in interfaces now? They
Lasse Reichstein Nielsen
2012/09/17 11:32:43
It's allowed since v. 0.09.
But it's true that it'
Mads Ager (google)
2012/09/17 11:37:26
Great, now that it is allowed I'm actually strongl
Johnni Winther
2012/09/19 09:03:30
It seems to be allowed now and the TODO above want
| |
| 52 int day, | 52 int day = 1, |
| 53 int hour, | 53 int hour = 0, |
| 54 int minute, | 54 int minute = 0, |
| 55 int second, | 55 int second = 0, |
| 56 int millisecond, | 56 int millisecond = 0, |
| 57 bool isUtc]); | 57 bool isUtc = false]); |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Constructs a new [Date] instance with current date time value in the | 60 * Constructs a new [Date] instance with current date time value in the |
| 61 * local time zone. | 61 * local time zone. |
| 62 */ | 62 */ |
| 63 Date.now(); | 63 Date.now(); |
| 64 | 64 |
| 65 /** | 65 /** |
| 66 * Constructs a new [Date] instance based on [formattedString]. | 66 * Constructs a new [Date] instance based on [formattedString]. |
| 67 */ | 67 */ |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 /** | 208 /** |
| 209 * Returns a new [Date] with the [duration] subtracted from this instance. | 209 * Returns a new [Date] with the [duration] subtracted from this instance. |
| 210 */ | 210 */ |
| 211 Date subtract(Duration duration); | 211 Date subtract(Duration duration); |
| 212 | 212 |
| 213 /** | 213 /** |
| 214 * Returns a [Duration] with the difference of [:this:] and [other]. | 214 * Returns a [Duration] with the difference of [:this:] and [other]. |
| 215 */ | 215 */ |
| 216 Duration difference(Date other); | 216 Duration difference(Date other); |
| 217 } | 217 } |
| OLD | NEW |