i'm working on project utilizing jquery datepicker, , trying use showweek attribute display week number next calender.
my problem don't want 'week 1' start on first of january, instead on first of august.
is there way can implement this?
thanks
working next month not working prev month have disabled prev month.
calender open august month if current month less august calender start previous year august.
working demo http://jsfiddle.net/cse_tushar/dr429/4
$(document).ready(function () { = 0; month_set = 8; var d = new date(); week = (math.ceil(math.round(((new date(d.getfullyear() + 1, 1)) - (new date(d.getfullyear(), 1))) / 86400000) / 7)); current_year = ((d.getmonth() + 1) >= month_set) ? d.getfullyear() : d.getfullyear() - 1; function myweekcalc() { i++; return = (i > week) ? 0 : i; } $("#d1").datepicker({ showweek: true, defaultdate: new date(current_year, month_set-1, 1), calculateweek: myweekcalc, onclose: function () { = 0; }, onchangemonthyear: function (year, month) { var diff = month - month_set; var d = new date(month + ' 1' + ',' + year); if (d.getday() != '0') { i--; } if (month == month_set) { = 0; } if (current_year != year && month == month_set) { week = (math.ceil(math.round(((new date(year + 1, 1)) - (new date(year, 1))) / 86400000) / 7)); } } }).focus(function () { $(".ui-datepicker-prev").remove(); }); });
Comments
Post a Comment