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

Side by Side Diff: frog/lib/date_implementation.dart

Issue 10416008: Revert "Add support for timezone offset and timezone name." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(jmesserly): the native class should be the real JS Date. 5 // TODO(jmesserly): the native class should be the real JS Date.
6 // TODO(jimhug): Making the date value non-lazy might be a good path there. 6 // TODO(jimhug): Making the date value non-lazy might be a good path there.
7 class DateImplementation implements Date { 7 class DateImplementation implements Date {
8 final int value; 8 final int value;
9 final TimeZone timeZone; 9 final TimeZone timeZone;
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return value; 120 return value;
121 } 121 }
122 122
123 Date changeTimeZone(TimeZone targetTimeZone) { 123 Date changeTimeZone(TimeZone targetTimeZone) {
124 if (targetTimeZone == null) { 124 if (targetTimeZone == null) {
125 targetTimeZone = new TimeZoneImplementation.local(); 125 targetTimeZone = new TimeZoneImplementation.local();
126 } 126 }
127 return new Date.fromEpoch(value, targetTimeZone); 127 return new Date.fromEpoch(value, targetTimeZone);
128 } 128 }
129 129
130 String get timeZoneName() { throw "Unimplemented"; }
131 Duration get timeZoneOffset() { throw "Unimplemented"; }
132
133 int get year() native 130 int get year() native
134 '''return this.isUtc() ? this._asJs().getUTCFullYear() : 131 '''return this.isUtc() ? this._asJs().getUTCFullYear() :
135 this._asJs().getFullYear();''' { 132 this._asJs().getFullYear();''' {
136 isUtc(); 133 isUtc();
137 _asJs(); 134 _asJs();
138 } 135 }
139 136
140 int get month() native 137 int get month() native
141 '''return this.isUtc() ? this._asJs().getUTCMonth() + 1 : 138 '''return this.isUtc() ? this._asJs().getUTCMonth() + 1 :
142 this._asJs().getMonth() + 1;''' { 139 this._asJs().getMonth() + 1;''' {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return isUtc == other.isUtc; 283 return isUtc == other.isUtc;
287 } 284 }
288 285
289 String toString() { 286 String toString() {
290 if (isUtc) return "TimeZone (UTC)"; 287 if (isUtc) return "TimeZone (UTC)";
291 return "TimeZone (Local)"; 288 return "TimeZone (Local)";
292 } 289 }
293 290
294 final bool isUtc; 291 final bool isUtc;
295 } 292 }
OLDNEW
« no previous file with comments | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698