Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#4127

💡 需求背景和解决方案

When timePickerProps.disableTime disables certain hours (e.g., 0-6), the initial time (00:00:00) remained at the disabled value instead of auto-adjusting to the first available time (07:00:00).

Issue Screenshot

Changes:

  • Added getFirstAvailableTime utility that finds the first non-disabled hour/minute/second combination
  • When popup opens with enableTimePicker + disableTime configured, automatically adjusts time to first available value
  • Updates time.value, inputValue, and cacheValue to stay in sync

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • fix(date-picker): 修复传入禁用时分秒选项时,初始时间未自动调整到第一个可用时间的问题

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供
Original prompt

This section details on the original issue you should resolve

<issue_title>[DatePicker 日期选择器] 传入禁用时分秒选项时选择不正确</issue_title>
<issue_description>### tdesign 版本

1.5.3

重现链接

No response

重现步骤

image
传入禁用时分秒选择时,点击确定后,选择器时间并没有按照禁用的小时展示

期望结果

2023-09-01 07:00:00

实际结果

2023-09-01 00:00:00

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

截图来自官网例子
https://tdesign.tencent.com/vue-next/components/date-picker?tab=demo#%E5%8F%AF%E7%A6%81%E7%94%A8%E6%97%A5%E6%9C%9F%E7%9A%84%E9%80%89%E6%8B%A9%E5%99%A8</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 29, 2025
@Wesley-0808
Copy link
Collaborator

Wesley-0808 commented Nov 29, 2025

@copilot 根据pr模版使用中文完善pr描述

Copilot AI changed the title [WIP] Fix date picker time selection with disabled options fix(date-picker): adjust initial time to first available when disableTime is set Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DatePicker 日期选择器] 传入禁用时分秒选项时选择不正确

2 participants