How to get week number for a date in jQuery
This is a useful function, who tell you week in the year for a custom date.
function(d) {
var day = d.getDay();
if(day == 0) day = 7;
d.setDate(d.getDate() + (4 - day));
var year = d.getFullYear();
var ZBDoCY = Math.floor((d.getTime() - new Date(year, 0, 1, -6)) / 86400000);
return 1 + Math.floor(ZBDoCY / 7);
}
1 Comments:
This comment has been removed by the author.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home