Skip to content

Conversation

Layouwen
Copy link
Member

原逻辑日期范围选择中, 第一次选中"开始"设置的是 [date1, date1] 而不是 [date1, 空值].
此时文案显示为 "开始", 第二次选中其他日期文案为 "结束", 设置第二个值 [date1, date2].

为了在不修改原逻辑, 而造成 breakchange.
所以将第一次选中的文案改为 "开始/结束", 作为语义修复的 Bug fix 来调整.

871a8f5a5b853aed1e33792bc1a32119

刚好可以解决该 issue 的问题 #6804

Copy link
Contributor

github-actions bot commented Jun 21, 2025

Preview is ready

Copy link

pkg-pr-new bot commented Jun 21, 2025

npm i https://pkg.pr.new/ant-design/ant-design-mobile/antd-mobile@6886

commit: e5042c0

Copy link

codecov bot commented Jun 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.78%. Comparing base (147c0a8) to head (e5042c0).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6886      +/-   ##
==========================================
+ Coverage   92.76%   92.78%   +0.01%     
==========================================
  Files         336      336              
  Lines        7230     7235       +5     
  Branches     1816     1818       +2     
==========================================
+ Hits         6707     6713       +6     
+ Misses        487      486       -1     
  Partials       36       36              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@afc163 afc163 enabled auto-merge (squash) June 21, 2025 16:45
@afc163 afc163 disabled auto-merge June 21, 2025 16:46
@afc163
Copy link
Member

afc163 commented Jun 21, 2025

这样是否会让用户觉得点一次就已经完成了当日到当日的选择了。

@Layouwen
Copy link
Member Author

这样是否会让用户觉得点一次就已经完成了当日到当日的选择了。

按原本的逻辑, 第一次选择, 就已经设置了两个当日的时间. [当前日期, 当前日期]
只有第二次选择, 才会覆盖为 [当前日期, 结束日期]. 如果不进行二次选择, 直接点确认, 返回值为 [当前日期, 当前日期].
这样的行为确实是 "点一次就已经完成了当日到当日的选择了"

之前有跟豆酱沟通过, 这个操作逻辑是有点别扭.
因为现有逻辑没有选择同一天选择的页面展示, 考虑额外增加一个 allowSameDay 之类的参数, 来允许同一天的日期选择.

但因为原本的逻辑就是第一次选择的时候, 已经设置了 [开始, 结束].
如果作为 feature 来修改, 需要调整第一次选择的时候, 只设置 [开始]. 会与之前的行为不一致, 造成 breakchange.
就考虑是否当做语义化问题处理

@Layouwen Layouwen requested a review from zombieJ June 21, 2025 17:27
@afc163 afc163 changed the title Fix the semantic error in the calendar description fix: the semantic error in Calendar description Jun 22, 2025
@zombieJ zombieJ merged commit 9af6960 into ant-design:master Jun 23, 2025
13 checks passed
@Layouwen Layouwen deleted the fix/calendar-semantic-error branch June 26, 2025 15:54
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.

3 participants