Skip to content

Commit

Permalink
Fix the enddate correction to the time picker increment
Browse files Browse the repository at this point in the history
The minutes of the end date were corrected to the time picker increment, but this was not saved to the end date.
The result was if time picker increment is 5, the minute drop down would always show 0, unless the minutes would be dividable by 5.
  • Loading branch information
mvandijk authored and fetrarij committed Mar 21, 2024
1 parent 8aac897 commit 92d5d6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/daterangepicker/daterangepicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ export class DaterangepickerComponent implements OnInit, OnChanges {
}

if (this.timePicker && this.timePickerIncrement) {
this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
this.endDate = this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
}

if (this.endDate.isBefore(this.startDate)) {
Expand Down Expand Up @@ -1438,7 +1438,7 @@ export class DaterangepickerComponent implements OnInit, OnChanges {
const minute = parseInt(String(this.timepickerVariables[side].selectedMinute), 10);
const second = this.timePickerSeconds ? parseInt(String(this.timepickerVariables[side].selectedSecond), 10) : 0;
return date.clone().hour(hour).minute(minute).second(second);

}else{
return;
}
Expand Down

0 comments on commit 92d5d6b

Please sign in to comment.