| Index: lib/compiler/implementation/lib/mockimpl.dart
|
| diff --git a/lib/compiler/implementation/lib/mockimpl.dart b/lib/compiler/implementation/lib/mockimpl.dart
|
| index 08648b963210d8818313dab8ad876dd86f21a81e..4dccbcdc021ed75be2a2fbb96deda524be8cbcf2 100644
|
| --- a/lib/compiler/implementation/lib/mockimpl.dart
|
| +++ b/lib/compiler/implementation/lib/mockimpl.dart
|
| @@ -166,6 +166,18 @@ class StringBase {
|
| }
|
| }
|
|
|
| +class TimeZoneImplementation implements TimeZone {
|
| + const TimeZoneImplementation.utc() : isUtc = true;
|
| + TimeZoneImplementation.local() : isUtc = false;
|
| +
|
| + bool operator ==(Object other) {
|
| + if (!(other is TimeZoneImplementation)) return false;
|
| + return isUtc == other.isUtc;
|
| + }
|
| +
|
| + final bool isUtc;
|
| +}
|
| +
|
| class DateImplementation implements Date {
|
| final int value;
|
| final bool _isUtc;
|
| @@ -184,6 +196,17 @@ class DateImplementation implements Date {
|
| _asJs();
|
| }
|
|
|
| + DateImplementation.withTimeZone(int years,
|
| + int month,
|
| + int day,
|
| + int hours,
|
| + int minutes,
|
| + int seconds,
|
| + int milliseconds,
|
| + TimeZoneImplementation timeZone)
|
| + : this(years, month, day, hours, minutes, seconds, milliseconds,
|
| + timeZone.isUtc);
|
| +
|
| DateImplementation.now()
|
| : _isUtc = false,
|
| value = Primitives.dateNow() {
|
| @@ -273,6 +296,13 @@ class DateImplementation implements Date {
|
| return new DateImplementation.fromEpoch(value, true);
|
| }
|
|
|
| + Date changeTimeZone(TimeZone targetTimeZone) {
|
| + if (targetTimeZone === null) {
|
| + targetTimeZone = new TimeZoneImplementation.local();
|
| + }
|
| + return new Date.fromEpoch(value, targetTimeZone.isUtc);
|
| + }
|
| +
|
| String get timeZoneName() {
|
| if (isUtc()) return "UTC";
|
| return Primitives.getTimeZoneName(this);
|
|
|