Permalink
Browse files

Fix issue 15: "Week calculation is wrong ... includes decimals"

According to the updated article,
http://techblog.procurios.nl/k/n618/news/view/33796/14863/calculate-iso-8601-week-and-year-in-javascript.html
either ceil or floor is needed. Choosing to use floor to keep the +1.
  • Loading branch information...
1 parent d0a752c commit 84f29cb2ccbe2dd45e4162c90e2b853b11a95df1 Brien Coffield committed Aug 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/dateformat.js
View
@@ -46,7 +46,7 @@ var dateFormat = function () {
// Number of weeks between target Thursday and first Thursday
var weekDiff = (targetThursday - firstThursday) / (86400000*7);
- return 1 + weekDiff;
+ return 1 + Math.floor(weekDiff);
},
/**

0 comments on commit 84f29cb

Please sign in to comment.