Remove all date time from the calendar event caption

Hi,

If I have event with a duration <= 30 minutes, the caption contains “:” separator and I am unable to remove it.
Is there a way, to remove the separator with CSS in CalendarEvent.
We need something in the server side to parameter the Calendar Component to disable this part of the caption:

calendarEvent.getTimeAsText()separator


Class DateCellDayEvent
    /**
     * @param bigMode
     *            If false, event is so small that caption must be in time-row
     */
    private void updateCaptions(boolean bigMode) {
        String separator = bigMode ? "<br />" : ": ";
        caption.setInnerHTML("<span>" + calendarEvent.getTimeAsText()
                + "</span>" + separator
                + Util.escapeHTML(calendarEvent.getCaption()));
        eventContent.setInnerHTML("");
    }

Hi

I’ve a same problem. I want update 2 things on my event caption display :

  • ignore the display of hour in the caption of my events.
  • and no use Util.escapeHTML because my actual caption can contain

I work with vaadin 7.1.15

Class com.vaadin.client.ui.calendar.schedule.DateCellDayEvent

/**
* @param bigMode
* If false, event is so small that caption must be in time-row
*/
private void updateCaptions(boolean bigMode) {
String innerHtml;
String escapedCaption = Util.escapeHTML(calendarEvent.getCaption());
String timeAsText = calendarEvent.getTimeAsText();
if (bigMode) {
innerHtml = "<span>" + timeAsText + "</span><br />" + escapedCaption;
} else {
innerHtml = "<span>" + timeAsText + "<span>:</span></span> " + escapedCaption;
}
caption.setInnerHTML(innerHtml);
eventContent.setInnerHTML("");
}

I was able to remove the default time in the calendar event by adding the below 2 styles

.v-calendar .v-calendar-event-caption > span { display: none; }
.v-calendar .v-calendar-event-caption > br { display: none; }

after that you can just set your own event caption by implementing the getCaption function of the CalendarEvent, don’t forget to call setEventCaptionAsHtml(true) on your calendar object if your getCaption implementation returns html