[gnome-continuous] b.g.o: Format date parts with leading digits



commit 67161cdbbb02af784a7b3710cda952ad8f564977
Author: Colin Walters <walters verbum org>
Date:   Wed Jan 1 07:21:20 2014 -0500

    b.g.o: Format date parts with leading digits
    
    For compatibility with how versioneddir.js does it.

 extras/build.gnome.org/controllers.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index b3efe36..536a650 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -102,9 +102,15 @@
             $scope.runningState = text;
         });
 
+       function formatDigits(x) {
+           if (x < 10)
+               return "0" + x;
+           return "" + x;
+       }
+
        var now = new Date();
        $scope.pushLogHref = "#/gnome-continuous/log/" + now.getUTCFullYear() + "/" +
-           (now.getUTCMonth()+1) + "/" + now.getUTCDate();
+           (formatDigits(now.getUTCMonth()+1)) + "/" + formatDigits(now.getUTCDate());
 
         var completedTasks = [];
         taskNames.forEach(function(taskName) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]