[DRE-commits] [SCM] Tracking the Debian/Ruby wheezy transition branch, master, updated. 530cdac22c28bac03bcedb229247ff48206fa680

Antonio Terceiro terceiro at softwarelivre.org
Wed Apr 6 19:06:22 UTC 2011


The following commit has been merged in the master branch:
commit 530cdac22c28bac03bcedb229247ff48206fa680
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Wed Apr 6 11:45:46 2011 -0700

    Extract method for building a proper date object

diff --git a/progressbar.js b/progressbar.js
index 89578b9..8c155e7 100644
--- a/progressbar.js
+++ b/progressbar.js
@@ -15,10 +15,15 @@ $(function() {
     });
 
     function to_date_string(date_as_number) {
+      var proper_date = to_proper_date(date_as_number)
+      return proper_date.getFullYear() + "/" + proper_date.getMonth() + "/" + proper_date.getDate();
+    }
+
+    function to_proper_date(date_as_number) {
       var year = Math.floor(date_as_number / 10000);
       var month = Math.floor(date_as_number % 10000 / 100);
       var day = Math.floor(date_as_number % 100);
-      return year + "/" + month + "/" + day;
+      return new Date(year, month, day);
     }
 
     $.plot(

-- 
Tracking the Debian/Ruby wheezy transition



More information about the Pkg-ruby-extras-commits mailing list