Skip to content

Commit e0a34a5

Browse files
authored
Merge pull request #998 from coder-xiaomo/master
修复 toISOString() 引发的时区问题(#919重新提交)
2 parents aeb5b73 + 48bdd8b commit e0a34a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uni_modules/uni-table/components/uni-th/filter-dropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
},
204204
resetDate() {
205205
let date = new Date()
206-
let dateText = date.toISOString().split('T')[0]
206+
let dateText = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
207207
this.dateRange = [dateText + ' 0:00:00', dateText + ' 23:59:59']
208208
},
209209
onDropdown(e) {

0 commit comments

Comments
 (0)