arshadulla / jquery-week-calendar

Automatically exported from code.google.com/p/jquery-week-calendar
0 stars 0 forks source link

gotoWeek option is not working in the week calendar #98

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
gotoWeek option is not working, if i assign a date it's not taking that, it
take the current date, i found today & gotoWeek option looks same.

Can u please show a demo how to work with the gotoWeek option.

Thanks
Hari

Original issue reported on code.google.com by ns.harik...@gmail.com on 26 Oct 2009 at 2:30

GoogleCodeExporter commented 8 years ago
I used a (jquery) datepicker to get this working:

HTML:
<input id="datepicker" type="text" onChange="jumptoDate(this.value)">

JS (added to the very end of demo.js):
    function jumptoDate(selectdate){
        var myDateParts = selectdate.split("/");
        var myJSDate = new Date(myDateParts[2], myDateParts[1]-1, myDateParts[0]);
        $('#calendar').weekCalendar('gotoWeek', myJSDate);
    }

Don't ask me why the second datepart needs 1 less (january is 0?). 
myDateParts[2] = Year
myDateParts[1] = Month
myDateParts[0] = Day

Original comment by joz...@gmail.com on 28 Jan 2010 at 4:22