Skip navigation

TempusDominus Picker

A tempus-dominus picker from Eonasdan v6

Simple datetime picker.

Configuration code:
new TempusDominusConfig()
    .withRestrictions(cfg -> cfg
        .withMinDate(Date.from(min.atStartOfDay(ZoneId.systemDefault()).toInstant()))
        .withMaxDate(Date.from(max.plusWeeks(2).atStartOfDay(ZoneId.systemDefault()).toInstant()))
    );
Birthday picker.

Configuration code:
new TempusDominusConfig()
    .withDisplay(cfg -> cfg
        .withViewMode(ViewModeType.YEARS)
        .withComponent(ComponentType.CLOCK, false)
    )
    .withLocalization(cfg -> cfg
        .withJavaFormat("dd/MM/yyyy")
    )
    .withRestrictions(cfg -> cfg
        .withMaxDate(Date.from(max.minusYears(6).atStartOfDay(ZoneId.systemDefault()).toInstant()))
    );
Datetime picker with FontAwesome icons.

Configuration code:
new TempusDominusConfig()
    .withDisplay(cfg -> cfg
        .withButton(ButtonType.TODAY, true)
        .withButton(ButtonType.CLEAR, true)
        .withButton(ButtonType.CLOSE, true)
        .withIcons(icons -> icons
            .withDateIcon(FontAwesome6IconType.calendar_days_r)
            .withTimeIcon(FontAwesome6IconType.clock_s)
            .withUpIcon(FontAwesome6IconType.arrow_up_s)
            .withDownIcon(FontAwesome6IconType.arrow_down_s)
            .withPreviousIcon(FontAwesome6IconType.arrow_left_s)
            .withNextIcon(FontAwesome6IconType.arrow_right_s)
            .withTodayIcon(FontAwesome6IconType.calendar_check_s)
            .withClearIcon(FontAwesome6IconType.eraser_s)
            .withCloseIcon(FontAwesome6IconType.xmark_s)
        )
    .withComponent(ComponentType.SECONDS, true)
)
.withLocalization(cfg -> cfg
    .withJavaFormat("dd/MM/yyyy HH:mm:ss")
);
Simple Local datetime picker.

Configuration code:
new TempusDominusConfig()
    .withClass(LocalDateTime.class)
    .withRestrictions(cfg -> cfg
        .withMinDate(min.atStartOfDay())
        .withMaxDate(max.atStartOfDay())
    )
    .withLocalization(cfg -> cfg
        .withJavaFormat("dd/MM/yyyy HH:mm:ss")
    );
LocalDate picker.

Configuration code:
new TempusDominusConfig()
    .withClass(LocalDate.class)
    .withDisplay(cfg -> cfg
        .withViewMode(ViewModeType.YEARS)
    )
    .withRestrictions(cfg -> cfg
        .withMaxDate(max.minusYears(6))
    );
LocalTime picker.

Configuration code:
new TempusDominusConfig()
    .withClass(LocalTime.class);
LocalDateTime based with icon.

Configuration code:
new TempusDominusConfig()
    .withClass(LocalDateTime.class)
    .withRestrictions(cfg -> cfg
        .withDayOfWeekDisabled(0)
        .withDayOfWeekDisabled(6)
    );