Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: sdk/lib/core/date_time.dart

Issue 14153003: Remove deprecated <, <=, >, and >= of DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | tests/corelib/date_time6_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A DateTime object represents a point in time. 8 * A DateTime object represents 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 */ 184 */
185 bool operator ==(other) { 185 bool operator ==(other) {
186 if (!(other is DateTime)) return false; 186 if (!(other is DateTime)) return false;
187 return (millisecondsSinceEpoch == other.millisecondsSinceEpoch && 187 return (millisecondsSinceEpoch == other.millisecondsSinceEpoch &&
188 isUtc == other.isUtc); 188 isUtc == other.isUtc);
189 } 189 }
190 190
191 /** 191 /**
192 * Returns true if [this] occurs before [other]. The comparison is independent 192 * Returns true if [this] occurs before [other]. The comparison is independent
193 * of whether the time is in UTC or in the local time zone. 193 * of whether the time is in UTC or in the local time zone.
194 *
195 * *Deprecated* Use [isBefore] instead.
196 */
197 @deprecated
198 bool operator <(DateTime other)
199 => millisecondsSinceEpoch < other.millisecondsSinceEpoch;
200
201 /**
202 * Returns true if [this] occurs at the same time or before [other]. The
203 * comparison is independent of whether the time is in UTC or in the local
204 * time zone.
205 *
206 * *Deprecated* Use [isAfter] instead ([:!isAfter:]).
207 */
208 @deprecated
209 bool operator <=(DateTime other)
210 => millisecondsSinceEpoch <= other.millisecondsSinceEpoch;
211
212 /**
213 * Returns true if [this] occurs after [other]. The comparison is independent
214 * of whether the time is in UTC or in the local time zone.
215 *
216 * *Deprecated* Use [isAfter] instead.
217 */
218 @deprecated
219 bool operator >(DateTime other)
220 => millisecondsSinceEpoch > other.millisecondsSinceEpoch;
221
222 /**
223 * Returns true if [this] occurs at the same time or after [other]. The
224 * comparison is independent of whether the time is in UTC or in the local
225 * time zone.
226 *
227 * *Deprecated* Use [isBefore] instead ([:!isBefore:]).
228 */
229 @deprecated
230 bool operator >=(DateTime other)
231 => millisecondsSinceEpoch >= other.millisecondsSinceEpoch;
232
233 /**
234 * Returns true if [this] occurs before [other]. The comparison is independent
235 * of whether the time is in UTC or in the local time zone.
236 */ 194 */
237 bool isBefore(DateTime other) { 195 bool isBefore(DateTime other) {
238 return millisecondsSinceEpoch < other.millisecondsSinceEpoch; 196 return millisecondsSinceEpoch < other.millisecondsSinceEpoch;
239 } 197 }
240 198
241 /** 199 /**
242 * Returns true if [this] occurs after [other]. The comparison is independent 200 * Returns true if [this] occurs after [other]. The comparison is independent
243 * of whether the time is in UTC or in the local time zone. 201 * of whether the time is in UTC or in the local time zone.
244 */ 202 */
245 bool isAfter(DateTime other) { 203 bool isAfter(DateTime other) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 * Returns the millisecond into the second [0...999]. 370 * Returns the millisecond into the second [0...999].
413 */ 371 */
414 external int get millisecond; 372 external int get millisecond;
415 373
416 /** 374 /**
417 * Returns the week day [MON..SUN]. In accordance with ISO 8601 375 * Returns the week day [MON..SUN]. In accordance with ISO 8601
418 * a week starts with Monday which has the value 1. 376 * a week starts with Monday which has the value 1.
419 */ 377 */
420 external int get weekday; 378 external int get weekday;
421 } 379 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | tests/corelib/date_time6_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698