]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Using moment.fn.dayOfYear in `DDD` token
authorTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 23:20:49 +0000 (15:20 -0800)
committerTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 23:20:49 +0000 (15:20 -0800)
moment.js

index 7dd0607301be54c024d6a39b2229392fd2146f0d..8dc2b8a9ab0630d38b78ff824a47cb77c8be8c84 100644 (file)
--- a/moment.js
+++ b/moment.js
@@ -88,9 +88,7 @@
                 return this.date();
             },
             DDD  : function () {
-                var a = new Date(this.year(), this.month(), this.date()),
-                    b = new Date(this.year(), 0, 1);
-                return ~~(((a - b) / 864e5) + 1.5);
+                return this.dayOfYear();
             },
             d    : function () {
                 return this.day();