Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // VM implementation of DateImplementation. | 6 // VM implementation of DateImplementation. |
| 7 patch class DateImplementation { | 7 patch class DateImplementation { |
| 8 /* patch */ DateImplementation(int year, | 8 /* patch */ DateImplementation(int year, |
| 9 [int month = 1, | 9 [int month = 1, |
| 10 int day = 1, | 10 int day = 1, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 : isUtc = false, | 24 : isUtc = false, |
| 25 millisecondsSinceEpoch = _getCurrentMs() { | 25 millisecondsSinceEpoch = _getCurrentMs() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 /* patch */ String get timeZoneName { | 28 /* patch */ String get timeZoneName { |
| 29 if (isUtc) return "UTC"; | 29 if (isUtc) return "UTC"; |
| 30 return _timeZoneName(millisecondsSinceEpoch); | 30 return _timeZoneName(millisecondsSinceEpoch); |
| 31 } | 31 } |
| 32 | 32 |
| 33 /* patch */ Duration get timeZoneOffset { | 33 /* patch */ Duration get timeZoneOffset { |
| 34 if (isUtc) return new Duration(0); | 34 if (isUtc) return new Duration(); |
|
Lasse Reichstein Nielsen
2012/09/13 09:30:46
If not introducing the zero-duration, be consisten
kasperl
2012/09/13 09:45:50
I'm reluctant to start refactoring these things wh
| |
| 35 int offsetInSeconds = _timeZoneOffsetInSeconds(millisecondsSinceEpoch); | 35 int offsetInSeconds = _timeZoneOffsetInSeconds(millisecondsSinceEpoch); |
| 36 return new Duration(seconds: offsetInSeconds); | 36 return new Duration(seconds: offsetInSeconds); |
| 37 } | 37 } |
| 38 | 38 |
| 39 /* patch */ int get year => _decomposeIntoYearMonthDay(_localDateInUtcMs)[0]; | 39 /* patch */ int get year => _decomposeIntoYearMonthDay(_localDateInUtcMs)[0]; |
| 40 | 40 |
| 41 /* patch */ int get month => _decomposeIntoYearMonthDay(_localDateInUtcMs)[1]; | 41 /* patch */ int get month => _decomposeIntoYearMonthDay(_localDateInUtcMs)[1]; |
| 42 | 42 |
| 43 /* patch */ int get day => _decomposeIntoYearMonthDay(_localDateInUtcMs)[2]; | 43 /* patch */ int get day => _decomposeIntoYearMonthDay(_localDateInUtcMs)[2]; |
| 44 | 44 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 | 315 |
| 316 static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch) | 316 static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch) |
| 317 native "DateNatives_timeZoneName"; | 317 native "DateNatives_timeZoneName"; |
| 318 | 318 |
| 319 static int _timeZoneOffsetInSecondsForClampedSeconds(int secondsSinceEpoch) | 319 static int _timeZoneOffsetInSecondsForClampedSeconds(int secondsSinceEpoch) |
| 320 native "DateNatives_timeZoneOffsetInSeconds"; | 320 native "DateNatives_timeZoneOffsetInSeconds"; |
| 321 | 321 |
| 322 static int _localTimeZoneAdjustmentInSeconds() | 322 static int _localTimeZoneAdjustmentInSeconds() |
| 323 native "DateNatives_localTimeZoneAdjustmentInSeconds"; | 323 native "DateNatives_localTimeZoneAdjustmentInSeconds"; |
| 324 } | 324 } |
| OLD | NEW |