Skip to content

Commit

Permalink
fix: [3871] fixed Picker.setStartDate not working when not accompanie…
Browse files Browse the repository at this point in the history
…d by setEndDate (#3873)
  • Loading branch information
shannah authored Feb 8, 2025
1 parent 898f4d6 commit 488e240
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CodenameOne/src/com/codename1/ui/spinner/Picker.java
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,16 @@ private DateSpinner3D createDatePicker3D() {
if (defaultValue.getTime() > endDate.getTime()) {
defaultValue = startDate;
}
} else if (startDate != null) {
out.setDateRange(startDate, null);
if (defaultValue.getTime() < startDate.getTime()) {
defaultValue = startDate;
}
} else if (endDate != null) {
out.setDateRange(null, endDate);
if (defaultValue.getTime() > endDate.getTime()) {
defaultValue = endDate;
}
}
if (value != null) {
out.setValue(value);
Expand Down

0 comments on commit 488e240

Please sign in to comment.