From 30b223bcdec1dda346e8fc50bfb0f7b89ab426d3 Mon Sep 17 00:00:00 2001 From: yinyueyu Date: Thu, 28 Mar 2024 17:27:46 +0800 Subject: [PATCH] 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> --- docs/examples/datetime-picker/date-and-time-range.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/datetime-picker/date-and-time-range.vue b/docs/examples/datetime-picker/date-and-time-range.vue index caf1019500..7002e8c611 100644 --- a/docs/examples/datetime-picker/date-and-time-range.vue +++ b/docs/examples/datetime-picker/date-and-time-range.vue @@ -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] }, },