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

Unified Diff: lib/core/date.dart

Issue 10948009: Revert 12494. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/coreimpl.dart ('k') | lib/core/duration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/date.dart
===================================================================
--- lib/core/date.dart (revision 12500)
+++ lib/core/date.dart (working copy)
@@ -13,7 +13,7 @@
*
* Also see [Stopwatch] for means to measure time-spans.
*/
-abstract class Date implements Comparable, Hashable {
+interface Date extends Comparable, Hashable default DateImplementation {
// Weekday constants that are returned by [weekday] method:
static const int MON = 1;
static const int TUE = 2;
@@ -45,30 +45,27 @@
* [month] and [day] are one-based. For example
* [:new Date(1938, 1, 10)] represents the 10th of January 1938.
*/
- factory Date(int year,
- [int month = 1,
- int day = 1,
- int hour = 0,
- int minute = 0,
- int second = 0,
- int millisecond = 0,
- bool isUtc = false]) {
- return new DateImplementation(year, month, day,
- hour, minute, second,
- millisecond, isUtc);
- }
+ // TODO(floitsch): the spec allows default values in interfaces, but our
+ // tools don't yet. Eventually we want to have default values here.
+ Date(int year,
+ [int month,
+ int day,
+ int hour,
+ int minute,
+ int second,
+ int millisecond,
+ bool isUtc]);
/**
* Constructs a new [Date] instance with current date time value in the
* local time zone.
*/
- factory Date.now() => new DateImplementation.now();
+ Date.now();
/**
* Constructs a new [Date] instance based on [formattedString].
*/
- factory Date.fromString(String formattedString)
- => new DateImplementation.fromString(formattedString);
+ Date.fromString(String formattedString);
/**
* Constructs a new [Date] instance with the given [millisecondsSinceEpoch].
@@ -80,12 +77,7 @@
*/
// TODO(floitsch): the spec allows default values in interfaces, but our
// tools don't yet. Eventually we want to have default values here.
- // TODO(lrn): Have two constructors instead of taking an optional bool.
- factory Date.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
- [bool isUtc = false]) {
- return new DateImplementation.fromMillisecondsSinceEpoch(
- millisecondsSinceEpoch, isUtc);
- }
+ Date.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, [bool isUtc]);
/**
* Returns true if [this] occurs at the same time as [other]. The
« no previous file with comments | « lib/compiler/implementation/lib/coreimpl.dart ('k') | lib/core/duration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698