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

Unified Diff: dart/frog/leg/lib/date_helper.dart

Issue 9424027: Implement Date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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: dart/frog/leg/lib/date_helper.dart
diff --git a/dart/frog/leg/lib/date_helper.dart b/dart/frog/leg/lib/date_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9c19ac66ac2a579df578a3155b076de40a243f11
--- /dev/null
+++ b/dart/frog/leg/lib/date_helper.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+String threeDigits(int n) {
+ if (n >= 100) return "${n}";
+ if (n > 10) return "0${n}";
+ return "00${n}";
+}
+
+String twoDigits(int n) {
+ if (n >= 10) return "${n}";
+ return "0${n}";
+}

Powered by Google App Engine
This is Rietveld 408576698