view resources/lib/Date.prototype.getDOY.js @ 790:17eeaa7d4f9c

Added tag 2.0-beta2 for changeset 1ef815f5b9fa
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 13 May 2015 11:32:06 +0200
parents a0cfe2395e0a
children
line wrap: on
line source

// A new Prototype to return the Day of the Year.
// Taken from: http://javascript.about.com/library/bldayyear.htm
Date.prototype.getDOY = function() {
    var onejan = new Date(this.getFullYear(),0,1);
    return Math.ceil((this - onejan) / 86400000);
}

http://lada.wald.intevation.org