| 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 interface Date extends Comparable, Hashable default DateImplementation { | 10 interface Date extends Comparable, Hashable default DateImplementation { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 * | 76 * |
| 77 * This constructor is the only one that doesn't need to be computations and | 77 * This constructor is the only one that doesn't need to be computations and |
| 78 * which can therefore be [:const:]. | 78 * which can therefore be [:const:]. |
| 79 * | 79 * |
| 80 * The constructed [Date] represents 1970-01-01T00:00:00Z + [value]ms in | 80 * The constructed [Date] represents 1970-01-01T00:00:00Z + [value]ms in |
| 81 * the given [timeZone]. | 81 * the given [timeZone]. |
| 82 */ | 82 */ |
| 83 const Date.fromEpoch(int value, TimeZone timeZone); | 83 const Date.fromEpoch(int value, TimeZone timeZone); |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Returns true if [this] occurs before [other]. The comparison is independent |
| 87 * of the timezone the [Date] is in. |
| 88 */ |
| 89 bool operator <(Date other); |
| 90 /** |
| 91 * Returns true if [this] occurs at the same time or before [other]. The |
| 92 * comparison is independent of the timezone the [Date] is in. |
| 93 */ |
| 94 bool operator <=(Date other); |
| 95 /** |
| 96 * Returns true if [this] occurs after [other]. The comparison is independent |
| 97 * of the timezone the [Date] is in. |
| 98 */ |
| 99 bool operator >(Date other); |
| 100 /** |
| 101 * Returns true if [this] occurs at the same time or after [other]. The |
| 102 * comparison is independent of the timezone the [Date] is in. |
| 103 */ |
| 104 bool operator >=(Date other); |
| 105 |
| 106 /** |
| 86 * Returns a new [Date] in the given [targetTimeZone] time zone. The | 107 * Returns a new [Date] in the given [targetTimeZone] time zone. The |
| 87 * [value] of the new instance is equal to [:this.value:]. | 108 * [value] of the new instance is equal to [:this.value:]. |
| 88 * | 109 * |
| 89 * This call is equivalent to | 110 * This call is equivalent to |
| 90 * [:new Date.fromEpoch(this.value, targetTimeZone):]. | 111 * [:new Date.fromEpoch(this.value, targetTimeZone):]. |
| 91 */ | 112 */ |
| 92 Date changeTimeZone(TimeZone targetTimeZone); | 113 Date changeTimeZone(TimeZone targetTimeZone); |
| 93 | 114 |
| 94 /** | 115 /** |
| 95 * Returns the year. | 116 * Returns the year. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 /** | 189 /** |
| 169 * Returns a new [Date] with the [duration] subtracted from this instance. | 190 * Returns a new [Date] with the [duration] subtracted from this instance. |
| 170 */ | 191 */ |
| 171 Date subtract(Duration duration); | 192 Date subtract(Duration duration); |
| 172 | 193 |
| 173 /** | 194 /** |
| 174 * Returns a [Duration] with the difference of [:this:] and [other]. | 195 * Returns a [Duration] with the difference of [:this:] and [other]. |
| 175 */ | 196 */ |
| 176 Duration difference(Date other); | 197 Duration difference(Date other); |
| 177 } | 198 } |
| OLD | NEW |