Mercurial > lada > lada-client
comparison resources/lib/Date.prototype.getDOY.js @ 782:a0cfe2395e0a
Added Prototype for Date to return DOY
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Tue, 12 May 2015 17:49:09 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
781:4c1101f0ba99 | 782:a0cfe2395e0a |
---|---|
1 | |
2 // A new Prototype to return the Day of the Year. | |
3 // Taken from: http://javascript.about.com/library/bldayyear.htm | |
4 Date.prototype.getDOY = function() { | |
5 var onejan = new Date(this.getFullYear(),0,1); | |
6 return Math.ceil((this - onejan) / 86400000); | |
7 } |