On Sunday, November 13, 2016 at 10:49:48 AM UTC+1, Jeremy Ruston wrote: > > I think the reason it happens at 23h00 local time might be because that's > when the corresponding UTC time flips into the next day. >
I think I found the problem. Some more tests needed. imo it's: https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/utils/utils.js#L361 that causes the problem especially: new Date(dt.getFullYear(),0,1) + 3600000 creates nonsense if you try it in the console. IMO getWeek needs too look like this: exports.getWeek = function(date) { var dt = new Date(date.getTime()); var d = dt.getDay(); if(d === 0) { 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); return Math.floor(n / 7) + 1; }; ------------------ Some more TW code to play with Week display, without waiting till 23:00 your time :) <$view field="created" format=date template="YYYY-MM-DD 0hh:0mm:0ss. -- kw: WW -- Z TZD"/><br> <$view field="time" format=date template="YYYY-MM-DD 0hh:0mm:0ss. -- kw: WW -- Z TZD"/> Add a field named: time to your tiddler eg: time: 20161112225959 have fun! mario PS: I'll create a PR after testing the fix. -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5130e224-8d46-48e6-a6b3-94beb1ddaf98%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

