Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FirstDayOfWeek error in SmartGWT 5.0

$
0
0
Hello,

there is an error with FirstDayOfWeek in the calendar of SmartGWT 5.0.

You can reproduce it with one of the calendars in the showcase.

Change the example, by setting the FirstDayOfWeek to 1 (Monday).
Code:

calendar.setFirstDayOfWeek(1);
1. When starting, the week view is ok. Monday is the first day.
2. Click on the header of the last day (Sunday)
3. The Sunday is in the day view.
4. Click on the "Week"-Tab
5. In the week view Monday isn't the first day. The first day is Sunday.

Something goes wrong here:
Code:

            case "w":
            case "W":
                // start of week
                var delta = Math.max(0, dayOfWeek-firstDayOfWeek);
                var endDate = dateVal - delta;
                if (logicalDate) {
                    return Date.createLogicalDate(year, month, endDate);
                } else {
                    return Date.createDatetime(year, month, endDate, 0, 0, 0, 0);
                }

I think, it is the Math.max...

Regards

Peter

Viewing all articles
Browse latest Browse all 4756

Trending Articles