Directory

← Back

Year Month Calendar Add-on

Full year / month calendar for Vaadin 22+

Author

Rating

Popularity

600+

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

Bug fixes:

  • cleanup CSS styles on empty cells in MonthCalendar (#58)
Released
2023-04-03
Maturity
TESTED
License
Apache License 2.0

Compatibility

Framework
Vaadin 22
Vaadin 23
Vaadin 24.4 in 4.2.1
Vaadin 24 in 4.2.0
Browser
Firefox
Safari
Google Chrome
iOS Browser
Android Browser
Microsoft Edge

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