| OLD | NEW |
| 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 // Dart core library. | 4 // Dart core library. |
| 5 | 5 |
| 6 class TimeZoneImplementation implements TimeZone { | 6 class TimeZoneImplementation implements TimeZone { |
| 7 const TimeZoneImplementation.utc() : isUtc = true; | 7 const TimeZoneImplementation.utc() : isUtc = true; |
| 8 TimeZoneImplementation.local() : isUtc = false {} | 8 TimeZoneImplementation.local() : isUtc = false {} |
| 9 | 9 |
| 10 bool operator ==(Object other) { | 10 bool operator ==(Object other) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 new TimeZoneImplementation.local()); | 30 new TimeZoneImplementation.local()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 DateImplementation.withTimeZone(int years, | 33 DateImplementation.withTimeZone(int years, |
| 34 int month, | 34 int month, |
| 35 int day, | 35 int day, |
| 36 int hours, | 36 int hours, |
| 37 int minutes, | 37 int minutes, |
| 38 int seconds, | 38 int seconds, |
| 39 int milliseconds, | 39 int milliseconds, |
| 40 TimeZoneImplementation timeZone) | 40 TimeZone timeZone) |
| 41 : timeZone = timeZone, | 41 : timeZone = timeZone, |
| 42 value = _brokenDownDateToMillisecondsSinceEpoch( | 42 value = _brokenDownDateToMillisecondsSinceEpoch( |
| 43 years, month, day, hours, minutes, seconds, milliseconds, | 43 years, month, day, hours, minutes, seconds, milliseconds, |
| 44 timeZone.isUtc) { | 44 timeZone.isUtc) { |
| 45 if (value === null) throw new IllegalArgumentException(); | 45 if (value === null) throw new IllegalArgumentException(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 DateImplementation.now() | 48 DateImplementation.now() |
| 49 : timeZone = new TimeZone.local(), | 49 : timeZone = new TimeZone.local(), |
| 50 value = getCurrentMs_() { | 50 value = getCurrentMs_() { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 static int getHours_(int secondsSinceEpoch, bool isUtc) | 418 static int getHours_(int secondsSinceEpoch, bool isUtc) |
| 419 native "DateNatives_getHours"; | 419 native "DateNatives_getHours"; |
| 420 | 420 |
| 421 static int getMinutes_(int secondsSinceEpoch, bool isUtc) | 421 static int getMinutes_(int secondsSinceEpoch, bool isUtc) |
| 422 native "DateNatives_getMinutes"; | 422 native "DateNatives_getMinutes"; |
| 423 | 423 |
| 424 static int getSeconds_(int secondsSinceEpoch, bool isUtc) | 424 static int getSeconds_(int secondsSinceEpoch, bool isUtc) |
| 425 native "DateNatives_getSeconds"; | 425 native "DateNatives_getSeconds"; |
| 426 } | 426 } |
| OLD | NEW |