Skip to content

fix: 调整日历日期 #2914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2025
Merged

fix: 调整日历日期 #2914

merged 2 commits into from
Jan 3, 2025

Conversation

xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented Jan 3, 2025

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 新功能

    • 更新了多个日历演示组件的日期范围和初始状态
    • 将日期值从2023年调整到2024-2026年
    • 修改了日历组件的起始日期和结束日期属性
  • Bug 修复

    • 无明显的 bug 修复
  • 文档

    • 无文档变更
  • 重构

    • 调整了日历演示组件中的日期设置,未改变核心逻辑

Copy link

coderabbitai bot commented Jan 3, 2025

概述

演练

此次更改主要涉及多个日历演示文件(H5和Taro版本)中的日期值更新。所有受影响的文件都调整了初始日期状态、日历组件的起始日期和结束日期,将日期范围推进到未来的年份。这些修改仅涉及日期值的更改,不会影响组件的核心功能和逻辑。

变更

文件路径 变更摘要
src/packages/calendar/demos/h5/demo*.tsx 更新初始日期状态和日历组件的起始/结束日期,大多将日期范围推进1-2年
src/packages/calendar/demos/taro/demo*.tsx 同H5版本,调整日期值到未来年份

可能相关的PR

建议标签

size/S

建议审阅者

  • oasis-cloud

诗歌

🐰 日历跳跃,时间飞翔
数字轻舞,年份更替
兔子微笑,代码优雅
未来已来,变更如风
🗓️ 时间旅人,代码诗篇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97be282 and 7f531be.

📒 Files selected for processing (1)
  • src/packages/calendar/demos/taro/demo10.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/packages/calendar/demos/taro/demo10.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the 2.x Target branch 2.x label Jan 3, 2025
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.02%. Comparing base (be5dec0) to head (7f531be).
Report is 2 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #2914   +/-   ##
=======================================
  Coverage   84.02%   84.02%           
=======================================
  Files         220      220           
  Lines       17917    17917           
  Branches     2628     2628           
=======================================
  Hits        15055    15055           
  Misses       2857     2857           
  Partials        5        5           

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
src/packages/calendar/demos/taro/demo2.tsx (1)

5-5: 演示默认值与文档同步

将默认日期改到 2025 年后,需及时更新文档或注释,避免与之前示例出现不一致的问题。

src/packages/calendar/demos/h5/demo8.tsx (1)

5-5: 初始日期建议在文档中做说明

预设值改到 2025 年后,如与业务示例无关,建议在演示文档中说明目的,提高示例可理解度。

src/packages/calendar/demos/taro/demo8.tsx (1)

36-37: 日历选择范围更改为 2024-12-22 至 2026-01-08,符合整体迁移至未来日期的设计思路。
建议在文档或注释中说明为何选择此时间段,便于后续维护。

src/packages/calendar/demos/taro/demo9.tsx (1)

60-61: 日历范围更新至 2024-2-22 ~ 2025-01-08,展示跨年度选择体验。
与其他文件的变更保持一致,便于全局功能验证。

src/packages/calendar/demos/taro/demo10.tsx (1)

76-76: 验证 scrollToDate 的目标日期
改动后的日期切换到 “2024-10-01”,请确保此日期在可滚动范围内,并与前后逻辑匹配。

src/packages/calendar/demos/h5/demo10.tsx (1)

138-138: 更新日历起始日期
将 startDate 改为 “2023-12-22”,建议与其他演示保持一致或在文档中说明使用场景,保证用户理解日期跨度。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be5dec0 and 97be282.

📒 Files selected for processing (20)
  • src/packages/calendar/demos/h5/demo10.tsx (3 hunks)
  • src/packages/calendar/demos/h5/demo11.tsx (2 hunks)
  • src/packages/calendar/demos/h5/demo2.tsx (2 hunks)
  • src/packages/calendar/demos/h5/demo3.tsx (1 hunks)
  • src/packages/calendar/demos/h5/demo4.tsx (1 hunks)
  • src/packages/calendar/demos/h5/demo5.tsx (1 hunks)
  • src/packages/calendar/demos/h5/demo6.tsx (1 hunks)
  • src/packages/calendar/demos/h5/demo7.tsx (0 hunks)
  • src/packages/calendar/demos/h5/demo8.tsx (2 hunks)
  • src/packages/calendar/demos/h5/demo9.tsx (2 hunks)
  • src/packages/calendar/demos/taro/demo10.tsx (3 hunks)
  • src/packages/calendar/demos/taro/demo11.tsx (2 hunks)
  • src/packages/calendar/demos/taro/demo2.tsx (2 hunks)
  • src/packages/calendar/demos/taro/demo3.tsx (1 hunks)
  • src/packages/calendar/demos/taro/demo4.tsx (1 hunks)
  • src/packages/calendar/demos/taro/demo5.tsx (1 hunks)
  • src/packages/calendar/demos/taro/demo6.tsx (1 hunks)
  • src/packages/calendar/demos/taro/demo7.tsx (0 hunks)
  • src/packages/calendar/demos/taro/demo8.tsx (2 hunks)
  • src/packages/calendar/demos/taro/demo9.tsx (2 hunks)
💤 Files with no reviewable changes (2)
  • src/packages/calendar/demos/taro/demo7.tsx
  • src/packages/calendar/demos/h5/demo7.tsx
✅ Files skipped from review due to trivial changes (6)
  • src/packages/calendar/demos/h5/demo3.tsx
  • src/packages/calendar/demos/taro/demo3.tsx
  • src/packages/calendar/demos/h5/demo4.tsx
  • src/packages/calendar/demos/taro/demo11.tsx
  • src/packages/calendar/demos/h5/demo11.tsx
  • src/packages/calendar/demos/h5/demo5.tsx
🔇 Additional comments (16)
src/packages/calendar/demos/h5/demo6.tsx (1)

83-84: 日历可选范围已更新

此处将开始日期调整为“2024-01-01”,结束日期调整为“2025-09-10”,成功将可选范围向后延长一年。请确保在您的业务逻辑与其它演示示例中也保持一致,并在测试环境下进一步验证新日期范围的可用性和正确性。

src/packages/calendar/demos/taro/demo4.tsx (1)

31-32: 更新演示用日历范围合理性

这些日期仅用于演示,改为未来时间没有问题,但请确认在实际业务场景中符合需求。同时建议确认是否需要与其他演示文件保持一致的时间跨度。

src/packages/calendar/demos/h5/demo2.tsx (2)

5-5: 默认值改动需检查业务逻辑

初始选择范围改为 2025 年起始,请确保在演示或文档中注明原因,避免对用户造成误解。


36-37: 统一日期区间设置

起始与结束日期均改至更远的区间,实现演示一致性不错。若无特殊原因,可考虑与其他文件保持相同起始与结束年份,保证产品演示的完备性。

src/packages/calendar/demos/taro/demo2.tsx (1)

36-37: 日历可选区间延长

在演示中跨到 2026 年方便用户看到更多情况,但请确保在实际使用中不会影响产品性能或用户体验。

src/packages/calendar/demos/h5/demo8.tsx (1)

36-37: 验证新时间跨度

同样调整为 2024-2026,如与其他演示保持一致则没问题。建议进行一次统一测试,确保演示效果正常。

src/packages/calendar/demos/taro/demo8.tsx (1)

5-5: 更新初始日期范围的改动合理,保证示例更贴近未来场景。
此处更改为 2025 年的日期区间,和其他 demo 保持一致,使用体验更真实。

src/packages/calendar/demos/taro/demo5.tsx (1)

37-38: 调整可选范围为 2025-01-01 至 2026-09-10,保持与其他示例一致。
如无特别业务需求,可与其他 demo 中的日期区间相互参考,确保测试与示例更统一。

src/packages/calendar/demos/h5/demo9.tsx (2)

13-13: 默认选中日期更新为 2024-06-12 至 2024-06-16。
示例更加贴近当前年限范围,演示效果更直观。


60-61: startDate 与 endDate 改为 2024-2-22 与 2025-01-08,方便跨年测试。
此举有助于用户在示例中验证跨年度场景。

src/packages/calendar/demos/taro/demo9.tsx (1)

13-13: 默认日期从 2023 更新为 2024,配合未来日期演示。
与整体日期统一,更能模拟真实跨年场景。

src/packages/calendar/demos/taro/demo10.tsx (2)

56-56: 确认初始日期范围是否符合预期
该行中初始数据从 2023 改为 2024,建议确认此日期是否与需求一致,以避免产生日期遗漏或展示异常。


135-135: 确认 startDate 的更新
startDate 改为 “2023-12-22”,若想实现跨年效果或与其他日历范围保持一致,需再次检查对应业务需求。

src/packages/calendar/demos/taro/demo6.tsx (1)

83-84: 检查日历的新增时间范围
起始日期调整为 “2024-01-01”,结束日期调整为 “2025-09-10”,请确认该区间是否满足业务场景,如需展示更远时间可考虑同步更新其他演示。

src/packages/calendar/demos/h5/demo10.tsx (2)

56-56: 确认日期初始化
初始值使用 “2024-07-10” 至 “2024-07-19”,请确保在文档或示例中明确说明具体场景。


76-76: 校验滚动定位日期
调用 scrollToDate(“2024-10-01”) 可能涉及大范围跳转,请在实际场景下进行验证,避免超出可选日期范围。

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 3, 2025
@xiaoyatong xiaoyatong requested a review from Miles-hxy January 3, 2025 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Target branch 2.x size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants