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

Unified Diff: frog/lib/date_implementation.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 | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/mockimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/date_implementation.dart
diff --git a/frog/lib/date_implementation.dart b/frog/lib/date_implementation.dart
index 2fea939f15a772e65c0cfce5b9482cd0a3601aa1..bab2e4572c5bff318f9061154d516d2f1cd59aca 100644
--- a/frog/lib/date_implementation.dart
+++ b/frog/lib/date_implementation.dart
@@ -104,6 +104,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) {
return value.compareTo(other.value);
}
« no previous file with comments | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/mockimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698