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

Unified Diff: runtime/lib/date.dart

Issue 10399027: Add comparison operators to Date class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add new lines. Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/lib/mockimpl.dart ('k') | tests/corelib/date_time6_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/date.dart
diff --git a/runtime/lib/date.dart b/runtime/lib/date.dart
index c670ab32ac41c05326605c4448db9eaf4c7c8509..8652125e3a3132a8ae7d1a0e6418857fd73df956 100644
--- a/runtime/lib/date.dart
+++ b/runtime/lib/date.dart
@@ -112,6 +112,14 @@ class DateImplementation implements Date {
return value == other.value && timeZone == other.timeZone;
}
+ bool operator <(Date other) => value < other.value;
+
+ bool operator <=(Date other) => value <= other.value;
+
+ bool operator >(Date other) => value > other.value;
+
+ bool operator >=(Date other) => value >= other.value;
+
int compareTo(Date other) => value.compareTo(other.value);
int hashCode() => value;
« no previous file with comments | « lib/compiler/implementation/lib/mockimpl.dart ('k') | tests/corelib/date_time6_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698