Extend Data with getWeek().

This commit is contained in:
Martin Edenhofer 2013-01-25 10:15:41 +01:00
parent 1f0a671c5c
commit 9f528316e7

View file

@ -38,3 +38,9 @@ if (!window.console) {
if (!console.log) {
console.log = function(){}
}
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(),0,1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
}