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

Side by Side Diff: frog/lib/date_implementation.dart

Issue 10382171: Make most arguments to Date constructor optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/mockimpl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « corelib/src/date.dart ('k') | lib/compiler/implementation/lib/mockimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698