Search code examples
datejs

setWeek year detection


Have a look at the year after setWeek

d = Date.today() 
Wed Dec 26 2012 00:00:00 GMT+0000 (GMT Standard Time) 
d.getWeek() 
52 
d.setWeek(52) 
Mon Dec 23 2013 00:00:00 GMT+0000 (GMT Standard Time)

Anyone knows what this is about? Have I misinterpreted how the setWeek function should work?


Solution

  • I have found an issue in the datejs tracker with this same problem. It's from 2011, though it's still marked as new: setWeek issue

    So regarding yor question of "Have I misinterpreted how the setWeek function should work?" I would say that it's a bug in the jdate code.