diff --git a/corelib/src/corelib_sources.gypi b/corelib/src/corelib_sources.gypi index 4dd45ccb57f..785938ebe3e 100644 --- a/corelib/src/corelib_sources.gypi +++ b/corelib/src/corelib_sources.gypi @@ -31,6 +31,5 @@ 'string.dart', 'strings.dart', 'string_buffer.dart', - 'time_zone.dart', ], } diff --git a/corelib/src/date.dart b/corelib/src/date.dart index 30c9d609a78..0b35247cd98 100644 --- a/corelib/src/date.dart +++ b/corelib/src/date.dart @@ -47,21 +47,6 @@ interface Date extends Comparable, Hashable default DateImplementation { int milliseconds, bool isUtc]); - /** - * Constructs a [Date] instance based on the individual parts. - * [timeZone] may not be [:null:]. - * - * *DEPRECATED* - */ - Date.withTimeZone(int year, - int month, - int day, - int hours, - int minutes, - int seconds, - int milliseconds, - TimeZone timeZone); - /** * Constructs a new [Date] instance with current date time value in the * local time zone. @@ -128,17 +113,6 @@ interface Date extends Comparable, Hashable default DateImplementation { */ Date toUtc(); - /** - * Returns a new [Date] in the given [targetTimeZone] time zone. The - * [value] of the new instance is equal to [:this.value:]. - * - * This call is equivalent to - * [:new Date.fromEpoch(this.value, targetTimeZone):]. - * - * *DEPRECATED* - */ - Date changeTimeZone(TimeZone targetTimeZone); - /** * Returns the abbreviated time-zone name. * diff --git a/corelib/src/time_zone.dart b/corelib/src/time_zone.dart deleted file mode 100644 index 5f12f935219..00000000000 --- a/corelib/src/time_zone.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -// Dart core library. - -/** - * [TimeZone]s represent locations (for example Europe/Paris). - * - * *DEPRECATED* - */ -interface TimeZone default TimeZoneImplementation { - const TimeZone.utc(); - TimeZone.local(); - bool get isUtc(); -} diff --git a/lib/compiler/implementation/lib/core.dart b/lib/compiler/implementation/lib/core.dart index 62ef9dbe0e3..a17e94abc7e 100644 --- a/lib/compiler/implementation/lib/core.dart +++ b/lib/compiler/implementation/lib/core.dart @@ -35,7 +35,6 @@ #source('../../../../corelib/src/string.dart'); #source('../../../../corelib/src/string_buffer.dart'); #source('../../../../corelib/src/strings.dart'); -#source('../../../../corelib/src/time_zone.dart'); #source('mock.dart'); #source('clock.dart'); diff --git a/lib/compiler/implementation/lib/mockimpl.dart b/lib/compiler/implementation/lib/mockimpl.dart index 4dccbcdc021..08648b96321 100644 --- a/lib/compiler/implementation/lib/mockimpl.dart +++ b/lib/compiler/implementation/lib/mockimpl.dart @@ -166,18 +166,6 @@ 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; @@ -196,17 +184,6 @@ 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() { @@ -296,13 +273,6 @@ 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); diff --git a/lib/compiler/implementation/scanner/source_list.dart b/lib/compiler/implementation/scanner/source_list.dart index b4e01ef55b5..aaca47eb5c9 100644 --- a/lib/compiler/implementation/scanner/source_list.dart +++ b/lib/compiler/implementation/scanner/source_list.dart @@ -76,7 +76,6 @@ final List argv = const [ '../corelib/src/string.dart', '../corelib/src/string_buffer.dart', '../corelib/src/strings.dart', -'../corelib/src/time_zone.dart', '../lib/json/json.dart', '../lib/utf/utf.dart', '../lib/utf/utf_core.dart', diff --git a/lib/i18n/date_format.dart b/lib/i18n/date_format.dart index b00e1b1ca13..1941f604b5a 100644 --- a/lib/i18n/date_format.dart +++ b/lib/i18n/date_format.dart @@ -230,8 +230,8 @@ class DateFormat { * Format the given [date] object according to preset pattern and current * locale and return a formated string for the given date. */ - String format(Date date, [TimeZone timeZone]) { - // TODO(efortuna): optional TimeZone argument? TimeZone is deprecated... + String format(Date date) { + // TODO(efortuna): readd optional TimeZone argument (or similar)? return date.toString(); } diff --git a/runtime/lib/date.dart b/runtime/lib/date.dart index 1654da7f6ea..d39fb8cf92f 100644 --- a/runtime/lib/date.dart +++ b/runtime/lib/date.dart @@ -3,18 +3,6 @@ // BSD-style license that can be found in the LICENSE file. // Dart core library. -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; -} - // VM implementation of DateImplementation. class DateImplementation implements Date { static final int _SECONDS_YEAR_2035 = 2051222400; @@ -33,17 +21,6 @@ class DateImplementation implements Date { if (value === null) throw new IllegalArgumentException(); } - DateImplementation.withTimeZone(int years, - int month, - int day, - int hours, - int minutes, - int seconds, - int milliseconds, - TimeZone timeZone) - : this(years, month, day, hours, minutes, seconds, milliseconds, - timeZone.isUtc); - DateImplementation.now() : _isUtc = true, value = _getCurrentMs() { @@ -131,13 +108,6 @@ 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 _timeZoneName(_equivalentSeconds(_secondsSinceEpoch)); diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart index f4df0053439..112bac2b994 100644 --- a/tests/standalone/io/http_headers_test.dart +++ b/tests/standalone/io/http_headers_test.dart @@ -289,8 +289,7 @@ void testCookie() { Cookie cookie; cookie = new Cookie("name", "value"); Expect.equals("name=value", cookie.toString()); - TimeZone utc = new TimeZone.utc(); - Date date = new Date.withTimeZone(2014, Date.JAN, 5, 23, 59, 59, 0, utc); + Date date = new Date(2014, Date.JAN, 5, 23, 59, 59, 0, isUtc: true); cookie.expires = date; checkCookie(cookie, "name=value" "; Expires=Sun, 5 Jan 2014 23:59:59 GMT");