mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +08:00
PL-8301 DateField rangeStart / rangeEnd do not respect user time zone
This commit is contained in:
parent
caf69da544
commit
500101fce2
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user