Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1164)

Unified Diff: runtime/lib/date.dart

Issue 10382171: Make most arguments to Date constructor optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/date.dart
diff --git a/runtime/lib/date.dart b/runtime/lib/date.dart
index dc69834bd167e91e47acffbcd361336fc2471927..bdfcca9c24f963645bd915e97125925681a4d6f2 100644
--- a/runtime/lib/date.dart
+++ b/runtime/lib/date.dart
@@ -18,12 +18,12 @@ class TimeZoneImplementation implements TimeZone {
// JavaScript implementation of DateImplementation.
class DateImplementation implements Date {
factory DateImplementation(int years,
- int month,
- int day,
- int hours,
- int minutes,
- int seconds,
- int milliseconds) {
+ [int month = 1,
+ int day = 1,
+ int hours = 0,
+ int minutes = 0,
+ int seconds = 0,
+ int milliseconds = 0]) {
return new DateImplementation.withTimeZone(
years, month, day,
hours, minutes, seconds, milliseconds,
@@ -112,8 +112,9 @@ class DateImplementation implements Date {
return value == other.value && timeZone == other.timeZone;
}
- int compareTo(Date other) => value.compareTo(other.value);
- int hashCode() => value;
ngeoffray 2012/05/15 12:17:35 bad mergE?
floitsch 2012/05/15 12:34:22 Done.
+ int compareTo(Date other) {
+ return value.compareTo(other.value);
+ }
Date changeTimeZone(TimeZone targetTimeZone) {
if (targetTimeZone === null) {
@@ -209,7 +210,7 @@ class DateImplementation implements Date {
}
String threeDigits(int n) {
if (n >= 100) return "${n}";
- if (n >= 10) return "0${n}";
ngeoffray 2012/05/15 12:17:35 ditto?
floitsch 2012/05/15 12:34:22 Done.
+ if (n > 10) return "0${n}";
return "00${n}";
}
String twoDigits(int n) {

Powered by Google App Engine
This is Rietveld 408576698