]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Adding passing day of year tests
authorTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 18:46:18 +0000 (10:46 -0800)
committerTim Wood <washwithcare@gmail.com>
Wed, 7 Nov 2012 18:46:18 +0000 (10:46 -0800)
moment.js

index 9f706a5ce741e3f22d78e6fda0775607cd470ab6..75b6705165ea55bc7949861587e267a99319e288 100644 (file)
--- a/moment.js
+++ b/moment.js
             return moment.utc([this.year(), this.month() + 1, 0]).date();
         },
 
+        dayOfYear : function () {
+            return moment(this).startOf('day').diff(moment(this).startOf('year'), 'days') + 1;
+        },
+
         isoWeek : function () {
             return weekOfYear(this, 1, 4);
         },