| 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 | 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 |
| 11 factory DateImplementation(int years, | 11 factory DateImplementation(int years, |
| 12 int month, | 12 [int month = 1, |
| 13 int day, | 13 int day = 1, |
| 14 int hours, | 14 int hours = 0, |
| 15 int minutes, | 15 int minutes = 0, |
| 16 int seconds, | 16 int seconds = 0, |
| 17 int milliseconds) { | 17 int milliseconds = 0]) { |
| 18 return new DateImplementation.withTimeZone( | 18 return new DateImplementation.withTimeZone( |
| 19 years, month, day, | 19 years, month, day, |
| 20 hours, minutes, seconds, milliseconds, | 20 hours, minutes, seconds, milliseconds, |
| 21 new TimeZoneImplementation.local()); | 21 new TimeZoneImplementation.local()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 DateImplementation.withTimeZone(int years, | 24 DateImplementation.withTimeZone(int years, |
| 25 int month, | 25 int month, |
| 26 int day, | 26 int day, |
| 27 int hours, | 27 int hours, |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 return isUtc == other.isUtc; | 275 return isUtc == other.isUtc; |
| 276 } | 276 } |
| 277 | 277 |
| 278 String toString() { | 278 String toString() { |
| 279 if (isUtc) return "TimeZone (UTC)"; | 279 if (isUtc) return "TimeZone (UTC)"; |
| 280 return "TimeZone (Local)"; | 280 return "TimeZone (Local)"; |
| 281 } | 281 } |
| 282 | 282 |
| 283 final bool isUtc; | 283 final bool isUtc; |
| 284 } | 284 } |
| OLD | NEW |