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

committed by
Jeremy Ruston

parent
3bceb98119
commit
766bc7acee
@@ -358,7 +358,8 @@ 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 n = Math.floor((dt.getTime()-new Date(dt.getFullYear(),0,1) + 3600000) / 86400000);
|
||||
var x = new Date(dt.getFullYear(),0,1);
|
||||
var n = Math.floor((dt.getTime() - x.getTime()) / 86400000);
|
||||
return Math.floor(n / 7) + 1;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user