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

Unified Diff: corelib/src/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 | « no previous file | frog/lib/date_implementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: corelib/src/date.dart
diff --git a/corelib/src/date.dart b/corelib/src/date.dart
index 3c83935ae65ca45856c946fa47b9da6dfbf2b32b..c3da9d00d9475a8a512db2082e81c47ea26766b1 100644
--- a/corelib/src/date.dart
+++ b/corelib/src/date.dart
@@ -83,6 +83,27 @@ interface Date extends Comparable, Hashable default DateImplementation {
const Date.fromEpoch(int value, TimeZone timeZone);
/**
+ * Returns true if [this] occurs before [other]. The comparison is independent
+ * of the timezone the [Date] is in.
+ */
+ bool operator <(Date other);
+ /**
+ * Returns true if [this] occurs at the same time or before [other]. The
+ * comparison is independent of the timezone the [Date] is in.
+ */
+ bool operator <=(Date other);
+ /**
+ * Returns true if [this] occurs after [other]. The comparison is independent
+ * of the timezone the [Date] is in.
+ */
+ bool operator >(Date other);
+ /**
+ * Returns true if [this] occurs at the same time or after [other]. The
+ * comparison is independent of the timezone the [Date] is in.
+ */
+ bool operator >=(Date other);
+
+ /**
* Returns a new [Date] in the given [targetTimeZone] time zone. The
* [value] of the new instance is equal to [:this.value:].
*
« no previous file with comments | « no previous file | frog/lib/date_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698