Skip to content

Commit

Permalink
feat: move start date when the 2nd click is before start date in date…
Browse files Browse the repository at this point in the history
…picker #218
  • Loading branch information
sun-mota committed Jan 16, 2025
1 parent a54800f commit bf2e38e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/datepicker/src/auro-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,11 @@ export class AuroDatePicker extends LitElement {
if (!this.value || !this.util.validDateStr(this.value)) {
this.value = newDate;
} else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd)) {

// verify the date is after this.value to insure we are setting a proper range
if (new Date(newDate) >= new Date(this.value)) {
this.valueEnd = newDate;
} else {
this.value = newDate;
}
} else {
this.value = newDate;
Expand Down

0 comments on commit bf2e38e

Please sign in to comment.