jsor/jcarousel — Issue #275: circular carousel and resize
Author: DaveB93
Created: 2011-11-25 01:11:00+00:00
State: open

Hi

I'm making a datepicker using jcarousel and trying to have a circular carousel and resize it but it seems to be misbehaving.

code is something like this:

var extraDays = new Date(year, month, 32).getDate();
var days = 32 - extraDays;
if (day > days) {
dayCarousel.scroll(days, false);
}
dayCarousel.size(days);

If you move from january 30th, and change the month carousel to february, it moves the date carousel back to the 28th, and sets the size of the date carousel to 28.

The problem comes when you hit the next button on the day carousel. if you hit next, it shows, 29, 30, 31, then 4, hitting previous at that point shows 3, 2, 1, ...

There is no issue if you start at january 1st, then switch the month to february, then hit the previous button. When you do that, it correctly jumps to the 28th, and if you hit next it correctly goes to 1, 2, 3, 4...

There further is an issue if you start at january 1st, switch the month to february, then hit next untill you get to the 28th, and then next again... it goes 29, 30, 31 ...

If i change the carousel's wrap to 'both' it behaves properly, but I prefer circular.