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

  • bugfixes
  • server-side methods to set the date
  • server-side methods to go to the next/previous year
Released
2011-12-11
Maturity
BETA
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.7+
Vaadin 6.2+ in 0.5
Vaadin 6.6+ in 1.0
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
Online