up
This commit is contained in:
@@ -113,3 +113,22 @@
|
||||
- `eventDidMount` 中为每个事件绑定 `contextmenu` 事件
|
||||
- `onMounted` 注册全局 click 关闭菜单,`onBeforeUnmount` 移除
|
||||
- i18n 新增 `calendar.copy_event/paste_event/copy_success/paste_success/no_event_to_paste`
|
||||
|
||||
## 修复:粘贴多天日程时结束日期少1天
|
||||
|
||||
**问题**:Ctrl+V 粘贴大于1天的日程时,目标结束日期少1天。
|
||||
|
||||
**原因**:`pasteToDate` 中用 `new Date(targetEndMs).toISOString().split('T')[0]` 计算目标结束日期,`toISOString()` 输出 UTC 时间,在 UTC+8 时区下日期会往前偏移1天。
|
||||
|
||||
**修复**(`CalendarDetail.vue` `pasteToDate` 函数):
|
||||
- 改用天数差 `Math.round((origEndDate - origStartDate) / 86400000)` 替代毫秒差
|
||||
- 用本地日期方法 `targetEndDate.setDate(targetEndDate.getDate() + diffDays)` + 手动拼接 `YYYY-MM-DD`,替代 `toISOString().split('T')[0]`
|
||||
|
||||
## 修复:Ctrl+C 无法复制大于1天的日程
|
||||
|
||||
**问题**:Ctrl+C 复制多天日程后粘贴无效果。
|
||||
|
||||
**根因**:`calendarOptions.value.events` 中多天事件的 `end` 是 `DateUtils.toCalendarEnd()` 返回的 **Date 对象**(非字符串)。Ctrl+C 直接 `selectedEvent.end || selectedEvent.start` 存入 clipboard,导致 `pasteToDate` 调用 `clipboard.value.end.split('T')[0]` 时 Date 对象没有 `split` 方法而报错。单天事件因走 `isSameDay` 分支不解析 `end`,所以不受影响。
|
||||
|
||||
**修复**(`CalendarDetail.vue` `handleKeyDown` Ctrl+C 分支):
|
||||
- 检测 `end` 是否为 Date 实例,如果是则用本地日期方法转为 `YYYY-MM-DD` 字符串再存入 clipboard
|
||||
|
||||
Reference in New Issue
Block a user