Directory

← Back

Year Month Calendar Add-on

Full year / month calendar for Vaadin 22+

Author

Rating

Popularity

500+

This addon can display a whole year calendar in one component.

Features

  • Java API for applying CSS class names to specific dates
  • Selection listener
  • Responsive layout

Sample code

    YearCalendar calendar = new YearCalendar();

    calendar.setClassNameGenerator(date -> {
      if (TestUtils.isPublicHoliday(date)) {
        return "holiday";
      }
      if (date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY) {
        return "weekend";
      }
      return null;
    });

    Span selectedDate = new Span();
    calendar.addDateSelectedListener(ev -> {
      selectedDate.setText("Selected date: " + ev.getDate());
    });

    Span instructions = new Span("Use arrow keys or Ctrl+arrow keys to move.");
    add(new HorizontalLayout(instructions, selectedDate), calendar);

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

New features:

  • Add support for min and max limits (#75)
Released
2023-12-11
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 24
Vaadin 23 in 2.0.2
Vaadin 22 in 2.0.0
Browser
N/A

Year Month Calendar Add-on - Vaadin Add-on Directory

Full year / month calendar for Vaadin 22+ Year Month Calendar Add-on - Vaadin Add-on Directory
This addon can display a whole year calendar in one component. ### Features * Java API for applying CSS class names to specific dates * Selection listener * Responsive layout
Online