Ero sivun ”Widget:Test4” versioiden välillä
Järvi-meriwikistä
Rivi 1 193: | Rivi 1 193: | ||
Date.prototype.getWeek = function() { | Date.prototype.getWeek = function() { | ||
var date = new Date(this.getTime()); | var date = new Date(this.getTime()); | ||
− | date.setHours( | + | date.setHours(12, 0, 0, 0); |
// Thursday in current week decides the year. | // Thursday in current week decides the year. | ||
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); | date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); |