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

Unified Diff: lib/compiler/implementation/lib/mockimpl.dart

Issue 10383218: Add support for timezone offset and timezone name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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 | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/mockimpl.dart
diff --git a/lib/compiler/implementation/lib/mockimpl.dart b/lib/compiler/implementation/lib/mockimpl.dart
index 2a6171f7adc2f2763a0c80bd84671d385692f1cf..5994d6d4547d624c33d87b99428c011607932708 100644
--- a/lib/compiler/implementation/lib/mockimpl.dart
+++ b/lib/compiler/implementation/lib/mockimpl.dart
@@ -297,6 +297,16 @@ class DateImplementation implements Date {
return new Date.fromEpoch(value, targetTimeZone);
}
+ String get timeZoneName() {
+ if (isUtc()) return "UTC";
+ return Primitives.getTimeZoneName(this);
+ }
+
+ Duration get timeZoneOffset() {
+ if (isUtc()) return new Duration(0);
+ return new Duration(minutes: Primitives.getTimeZoneOffsetInMinutes(this));
+ }
+
int get year() => Primitives.getYear(this);
int get month() => Primitives.getMonth(this);
« no previous file with comments | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698