mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
docs(components): [date-picker] update calculation of shortcut key values (#16262)
* Update date-and-time-range.vue Modified the calculation of the time control date range selection to a date function in JavaScript to correctly calculate the time span. * Update docs/examples/datetime-picker/date-and-time-range.vue --------- Co-authored-by: btea <2356281422@qq.com>
This commit is contained in:
parent
fa91eddb0d
commit
30b223bcde
@ -37,7 +37,7 @@ const shortcuts = [
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
start.setDate(start.getDate() - 7)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
@ -46,7 +46,7 @@ const shortcuts = [
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
start.setMonth(start.getMonth() - 1)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
@ -55,7 +55,7 @@ const shortcuts = [
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
start.setMonth(start.getMonth() - 3)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user