Directory

← Back

StyleCalendar

A simple calendar component.

Author

Contributors

Rating

StyleCalendars goal is to offer a simple, extendable calendar component with an easily themeable client-side DOM structure.

Its features include:

  • setting stylenames for individual days
  • disabling date ranges and individual days
  • customizable header and week numbers
  • tooltip support

Also includes a StyleCalendarField component which is a simple textfield that uses StyleCalendar as a popup for date selection. This feature is experimental.

Sample code

Java:

StyleCalendar sc = new StyleCalendar();

sc.setDateStyleGenerator(new StyleCalendar.DateStyleGenerator()

           @Override
            public String getStyleName(Date date, StyleCalendar context) {
                Date now = new Date();

                if (date.after(now)) {
                    return "future";
                } else if (date.before(now)) {
                    return "past";
                } else {
                    return null;
                }
            }
});

CSS:

.v-stylecalendar .future {
	background-color: red;
}

.v-stylecalendar .past {
	background-color: blue;
}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • tooltip support
  • bugfixes
  • StyleCalendarField
Released
2012-04-08
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.6+
Vaadin 6.2+ in 0.5
Vaadin 6.7+ in 0.6
Vaadin 7.0+ in 2.0
Vaadin 7.7+ in 2.2.0
Browser
Internet Explorer
Firefox
Safari
Google Chrome

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online