Here you can find the source of getWeek()
Date.prototype.getWeek = function() { var onejan = new Date(this.getFullYear(),0,1); return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7); }
'use strict'; Date.prototype.getWeek = function () { var firstOfJanuary = new Date(this.getFullYear(), 0, 1); return Math.ceil((((this - firstOfJanuary) / 86400000) + firstOfJanuary.getDay() + 1) / 7); };
Date.prototype.getWeek = function() { var dt = new Date(this.getFullYear(),0,1); return Math.ceil((((this - dt) / 86400000) + dt.getDay()+1)/7); };
function getRandomColor() { return "rgb("+Math.floor((Math.random()*255)+1)+","+ Math.floor((Math.random()*255)+1)+","+ Math.floor((Math.random()*255)+1)+")"; Date.prototype.getWeek = function() { var onejan = new Date(this.getFullYear(),0,1); return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
Date.prototype.getWeek = function() { var onejan = new Date(this.getFullYear(), 0, 1); return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7); var weekNumber = (new Date()).getWeek(); var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var now = new Date(); document.write(dayNames[now.getDay()] + " (" + weekNumber + ").");