Skip to content

Commit

Permalink
Merge pull request #945 from dcloudio/fix-datetimepicker-range
Browse files Browse the repository at this point in the history
fix:修复uni-datetime-picker在datetimerange下选择日期不正确的bug  (question/197442)
  • Loading branch information
GRCmade authored Aug 29, 2024
2 parents 8cb413f + 2cd5a20 commit 83c57d9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,11 @@
startString = getDateTime(this.start, this.hideSecond)
}
[startDate, startTime] = startString.split(' ')
if (this.start && !dateCompare(this.start, this.tempRange.startDate)) {
if (this.start && !dateCompare(this.start, `${this.tempRange.startDate} ${this.tempRange.startTime}`)) {
startDateLaterRangeStartDate = true
this.tempRange.startDate = startDate
}
if (this.start && !dateCompare(this.start, this.tempRange.endDate)) {
if (this.start && !dateCompare(this.start, `${this.tempRange.endDate} ${this.tempRange.endTime}`)) {
startDateLaterRangeEndDate = true
this.tempRange.endDate = startDate
}
Expand All @@ -717,11 +717,11 @@
}
[endDate, endTime] = endString.split(' ')
if (this.end && !dateCompare(this.tempRange.startDate, this.end)) {
if (this.end && !dateCompare(`${this.tempRange.startDate} ${this.tempRange.startTime}`, this.end)) {
endDateEarlierRangeStartDate = true
this.tempRange.startDate = endDate
}
if (this.end && !dateCompare(this.tempRange.endDate, this.end)) {
if (this.end && !dateCompare(`${this.tempRange.endDate} ${this.tempRange.endTime}`, this.end)) {
endDateEarlierRangeEndDate = true
this.tempRange.endDate = endDate
}
Expand Down

1 comment on commit 83c57d9

@GRCmade
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.