You will need to create your own weekly calculation, see the docs for jQuery UI calculateWeek . Its beginning, but not too useful in these documents. A little more helpful was this blog post here .
In any case, here is the code I managed to crack, see the link below to see how it works.
Define a datapicker:
$("#mydatepicker").datepicker({ calculateWeek: fisc, maxDate: '08/25/12', minDate: '08/28/11', showWeek: true });
And weeks calculation function:
function fisc(date) { var checkDate = new Date(date.getTime()); checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); var time = checkDate.getTime(); checkDate.setMonth(7); checkDate.setDate(28); var week = (Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 2); if (week < 1) { week = 52 + week; } return 'FW: '+week; }
Click here to see it in action.
I'm sure this is probably not the perfect way to do this, but it seems to be working at this time of night, hopefully it will point you in the right direction.
source share