Hello dear vaadin forum users!
I’m new in vaadin framework, but want to learn more. So i tried to reproduce my previous web interface writen in spring boot MVC in vaadin. So i faced next issue. Vaadin doesn’t have much functionality in date picker. In my case I need date-time range picker and in old project I used this component: https://www.daterangepicker.com/. I also found something similar for vaadin here https://vaadin.com/directory/component/bootstrap-datetimerangepicker-add-on/overview. But now I have no idea how to use it, I tried to read some docs in github, look at examples, but it looks very complicated for me. Can someone explain to me, how can i use this add-on as vaadin component in my project? I’m not able to add this as vaadin component because DateTimeRangeField class is not part of it. I’m trying to use this in class, that extends Dialog.
public class AddTourForm extends Dialog {
private static final String DATE_PATTERN = "dd-MM-yyyy";
private static final Format DATE_FORMATTER = new SimpleDateFormat(AddTourForm.DATE_PATTERN);
private TextField title = new TextField();
private TextField description = new TextField();
private DateTimeRangeField date = new DateTimeRangeField(DATE_FORMATTER, true, true);
public AddTourForm() {
setupDatePicker();
add(title,description);
}
private void setupDatePicker(){
date.autoApply(true);
date.timePicker(true);
date.timePicker24Hour(true);
date.timePickerIncrement(5);
}
}
DemoUI from github also didn’t helps. Even if I just try to create an object (new DateTimeRangeField) it throws null pointer exception.
Note: instead of maven I’m using gradle, maybe because of this I cannot try DemoUI described in github. Anyway please help me to find out solution.
Thanks!