1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-19 09:47:38 +00:00

@pmario's fix for #2635

This got reverted due to my git inabilities
This commit is contained in:
Jermolene
2016-11-28 13:43:43 +00:00
parent c65d08240b
commit b759d82f4c
2 changed files with 1 additions and 29 deletions

View File

@@ -358,8 +358,7 @@ exports.getWeek = function(date) {
d = 7; // JavaScript Sun=0, ISO Sun=7
}
dt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week to calculate weekNo
var x = new Date(dt.getFullYear(),0,1);
var n = Math.floor((dt.getTime() - x.getTime()) / 86400000);
var n = Math.floor((dt.getTime()-new Date(dt.getFullYear(),0,1) + 3600000) / 86400000);
return Math.floor(n / 7) + 1;
};