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

Unified Diff: frog/lib/date_implementation.dart

Issue 10538061: Reapply "Remove deprecated classes and functions in Date." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « frog/lib/corelib.dart ('k') | lib/compiler/implementation/lib/core.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 5151804ab51ea1c969a3f02d852530a2dd60be09..8ddd6cc6d5ea3bd29c64a9f6465d0241f3bb3751 100644
--- a/frog/lib/date_implementation.dart
+++ b/frog/lib/date_implementation.dart
@@ -19,8 +19,8 @@ class DateImplementation implements Date {
return new DateImplementation.withTimeZone(
years, month, day,
hours, minutes, seconds, milliseconds,
- isUtc ? const TimeZoneImplementation.utc()
- : new TimeZoneImplementation.local());
+ isUtc ? const TimeZone.utc()
+ : new TimeZone.local());
}
DateImplementation.withTimeZone(int years,
@@ -99,8 +99,7 @@ class DateImplementation implements Date {
}
DateImplementation.fromEpoch(this.value, [bool isUtc = false])
- : this.timeZone = isUtc ? const TimeZoneImplementation.utc()
- : new TimeZoneImplementation.local();
+ : this.timeZone = isUtc ? const TimeZone.utc() : new TimeZone.local();
bool operator ==(other) {
if (other is !DateImplementation) return false;
@@ -124,18 +123,18 @@ class DateImplementation implements Date {
}
Date toLocal() {
- if (isUtc()) return changeTimeZone(new TimeZoneImplementation.local());
+ if (isUtc()) return changeTimeZone(new TimeZone.local());
return this;
}
Date toUtc() {
if (isUtc()) return this;
- return changeTimeZone(const TimeZoneImplementation.utc());
+ return changeTimeZone(const TimeZone.utc());
}
Date changeTimeZone(TimeZone targetTimeZone) {
if (targetTimeZone == null) {
- targetTimeZone = new TimeZoneImplementation.local();
+ targetTimeZone = new TimeZone.local();
}
return new Date.fromEpoch(value, targetTimeZone.isUtc);
}
@@ -284,13 +283,12 @@ class DateImplementation implements Date {
return this.date;''';
}
-// Trivial implementation of TimeZone
-class TimeZoneImplementation implements TimeZone {
- const TimeZoneImplementation.utc() : this.isUtc = true;
- const TimeZoneImplementation.local() : this.isUtc = false;
+class TimeZone {
+ const TimeZone.utc() : this.isUtc = true;
+ const TimeZone.local() : this.isUtc = false;
bool operator ==(other) {
- if (other is !TimeZoneImplementation) return false;
+ if (other is !TimeZone) return false;
return isUtc == other.isUtc;
}
« no previous file with comments | « frog/lib/corelib.dart ('k') | lib/compiler/implementation/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698