Skip to content

Commit

Permalink
fix:修复uni-datetime-picker在datetimerange下选择日期不正确的bug (question/197442)
Browse files Browse the repository at this point in the history
  • Loading branch information
GRCmade committed Aug 29, 2024
1 parent 8cb413f commit 2cd5a20
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

0 comments on commit 2cd5a20

Please sign in to comment.