feat: DatePicker add date range picker#323
Merged
Merged
Conversation
# Conflicts: # packages/arcodesign/components/date-picker/index.tsx # packages/arcodesign/components/date-picker/type.ts
# Conflicts: # packages/arcodesign/tokens/src/arcodesign/default/index.js
…co-design-mobile into feat-date-picker # Conflicts: # packages/arcodesign/components/date-picker/index.tsx
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a date range picker to the DatePicker component and updates the theming tokens, types, demos, and tests accordingly.
- New tokens are introduced for styling the date range elements.
- The DatePicker component is modified to handle range values with updates to state management and rendering.
- Documentation, test cases, snapshots, and type definitions are updated to support date range functionality.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/arcodesign/tokens/* | Added new tokens for date range background, font size, padding, etc. |
| packages/arcodesign/components/date-picker/* | Updated DatePicker to support date range picker functionality and added new props and related logic. |
| packages/arcodesign/components/picker/* | Added renderExtraHeader prop to allow custom header rendering. |
| packages/arcodesign/components/form/linked-container.tsx | Enhanced linked container to handle range values. |
| packages/arcodesign/components/date-picker/demo/, test/, README* | Updated demos, tests, and documentation to reflect the new API. |
Comments suppressed due to low confidence (2)
packages/arcodesign/components/date-picker/index.tsx:63
- [nitpick] The local variables minTs and maxTs obtained from useMemo shadow the prop names (userSetMinTs, userSetMaxTs), which could make the code harder to follow. Consider renaming them (e.g., computedMinTs, computedMaxTs) for improved clarity.
const [minTs, maxTs] = useMemo(() => { return _updateTimeScope(); }, [userSetMinTs, userSetMaxTs, activeTabIndex]);
packages/arcodesign/components/date-picker/index.tsx:337
- [nitpick] The use of reduce here to build an array of date objects is a bit compact and may be less readable. Consider refactoring this logic into a more explicit loop or function for better clarity.
nowDateObj = keyOptions.reduce((arr, key) => { arr[0][key] = leftTimeObj[key]; arr[1][key] = rightTimeObj[key]; return arr; }, [{} as IDateObj, {} as IDateObj]);
adaex
approved these changes
May 13, 2025
ziqisia
pushed a commit
that referenced
this pull request
May 21, 2025
Authored-by: jianyi-gronk <jianyi_gronk@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.