Wrong week number in DateField


I see a bug in the DateField component, the calculated week is wrong, there are 2 week 13.

I see that there was a correction in vaadin 7 http://dev.vaadin.com/ticket/14437 but I use Vaadin 6. Can I change that in my code?

Thanks for your quick response we are in week 14…


Hi Julie,

I think you can make the change yourself, though might be tricky. The idea would be to override the client widget and set the corrent week number after it’s set wrong by the widget itself. From what I’ve looked the object that wraps this is private field - look for VCalendarPanel.days. But running on the browser you should be able to access the specific dom element and make the change directly. Also you need to link your widget with a server side component which should override the PopupDateField and add the @ClientWidget. To figure out all this best would be to read our code starting with DateTimeService.getISOWeekNumber, where the problem is. See where is it used and how to replace the element in the dom.

Another option would be to fork the framework yourself and change directly there. In this case you’d need to compile it and build it yourself. Please check our license for that: https://vaadin.com/license

I’ll also create a ticket similar with the one in v7.

All the best,