Is it possible to “style” the Vaadin calendar component so that when using it to display a full month, let say january 2012, the day prior to the 1st jan 2012 and after the 31. jan 2102 are displayed in some kind of grey cells.
At the moment when I use default settings with startDate=01.01.2012 and endDate=31.01.2012, cells for days at the end of dec 2011 and beginning of feb 2012 are also displayed.
in the attached image, I surrounded in red those cells I would like to style as “grey cells” for instance. (or even hide would be better)
here is a reply (or attempt) to myself in case someone wants to take over and go further on this :dry:
So here is the hack I did to make my initial idea work.
In my project, I’ve overriden the calendar widget class : com.vaadin.addon.calendar.gwt.client.ui.VCalendar and in the updateMonthGrid,
I’ve added some control logic to check if the current cell is within the current month range or not. Then I’ve added a simple “notinrange” css class to gray out
those out-of-range cells.
At the end I get what I wanted, this is a isolation in a month grid view of the day-cells that are not part of the
displayed month. I suppose the same could be achieve with some much nicer code with some parametrization on the Vaadin part
of the widget (no in the GWT class).