Search in sources :

Example 1 with DateTimeService

use of com.vaadin.client.DateTimeService in project cuba by cuba-platform.

the class CubaDateFieldWidget method adjustStringValue.

protected String adjustStringValue(String value) {
    DateTimeService service = getDateTimeService();
    Date date = service.parseDate(value, getFormatString(), lenient);
    Date adjustedDate = adjustDateByRange(date, getDateRangeStart(), getDateRangeEnd());
    return date.equals(adjustedDate) ? value : service.formatDate(adjustedDate, getFormatString());
}
Also used : DateTimeService(com.vaadin.client.DateTimeService) Date(java.util.Date)

Aggregations

DateTimeService (com.vaadin.client.DateTimeService)1 Date (java.util.Date)1