PL-8301 DateField rangeStart / rangeEnd do not respect user time zone

This commit is contained in:
Yuriy Artamonov 2016-12-05 17:00:03 +04:00
parent caf69da544
commit 500101fce2
2 changed files with 9 additions and 4 deletions

View File

@ -248,12 +248,14 @@ public class DesktopDateField extends DesktopAbstractField<JPanel> implements Da
}
if (value != null) {
if (startDate != null && value.before(startDate)) {
Date rangeStart = getRangeStart();
if (rangeStart != null && value.before(rangeStart)) {
handleDateOutOfRange(value);
return false;
}
if (endDate != null && value.after(endDate)) {
Date rangeEnd = getRangeEnd();
if (rangeEnd != null && value.after(rangeEnd)) {
handleDateOutOfRange(value);
return false;
}

View File

@ -172,12 +172,14 @@ public class WebDateField extends WebAbstractField<CubaDateFieldWrapper> impleme
}
if (value != null) {
if (dateField.getRangeStart() != null && value.before(dateField.getRangeStart())) {
Date rangeStart = getRangeStart();
if (rangeStart != null && value.before(rangeStart)) {
handleDateOutOfRange(value);
return false;
}
if (dateField.getRangeEnd() != null && value.after(dateField.getRangeEnd())) {
Date rangeEnd = getRangeEnd();
if (rangeEnd != null && value.after(rangeEnd)) {
handleDateOutOfRange(value);
return false;
}
@ -468,6 +470,7 @@ public class WebDateField extends WebAbstractField<CubaDateFieldWrapper> impleme
}
}
// Returns date value in server time zone
protected Date constructDate() {
final Date datePickerDate = dateField.getValue();
if (datePickerDate == null) {