Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a vaadin component to choose date and time both

I am using PopupDateField component of vaadin and it only allows to select the Day not with time. Is there any other component in vaadin that this capability is or is there any way I can change the PopupDateField to support time choosing?

This is my code now

        PopupDateField popupDateFieldScheduled = new PopupDateField();
        popupDateFieldScheduled.setImmediate(false);
        popupDateFieldScheduled.setWidth("-1px");
        popupDateFieldScheduled.setHeight("-1px");
        popupDateFieldScheduled.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
like image 218
Sanjaya Liyanage Avatar asked Dec 20 '22 03:12

Sanjaya Liyanage


1 Answers

The default resolution of a DateField in Vaadin 7 is Day. You can configure it by using DateField#setReolution, i.e. popupDateFieldScheduled.setResolution(Resolution.SECOND)

like image 194
Charles Anthony Avatar answered Dec 31 '22 15:12

Charles Anthony