Skip to content

PLASMA-7233: make DatePickerRange inputs independent#2814

Open
TitanKuzmich wants to merge 3 commits into
devfrom
PLASMA-7233
Open

PLASMA-7233: make DatePickerRange inputs independent#2814
TitanKuzmich wants to merge 3 commits into
devfrom
PLASMA-7233

Conversation

@TitanKuzmich
Copy link
Copy Markdown
Contributor

@TitanKuzmich TitanKuzmich commented May 28, 2026

Core

DatePickerRange

  • поля ввода независимы друг от друга: можно выбрать только конец периода или только начало
  • исправлено условие включения минимальной даты для includeEdgeDates

What/why changed

calendar independent inputs
  • поля ввода независимы друг от друга: можно выбрать только конец периода или только начало
  • исправлено условие включения минимальной даты для includeEdgeDates
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/plasma-asdk@0.378.0-canary.2814.26576874879.0
npm install @salutejs/plasma-b2c@1.620.0-canary.2814.26576874879.0
npm install @salutejs/plasma-core@1.228.0-canary.2814.26576874879.0
npm install @salutejs/plasma-giga@0.347.0-canary.2814.26576874879.0
npm install @salutejs/plasma-homeds@0.347.0-canary.2814.26576874879.0
npm install @salutejs/plasma-hope@1.374.0-canary.2814.26576874879.0
npm install @salutejs/plasma-icons@1.239.0-canary.2814.26576874879.0
npm install @salutejs/plasma-new-hope@0.364.0-canary.2814.26576874879.0
npm install @salutejs/plasma-tokens-b2b@1.56.0-canary.2814.26576874879.0
npm install @salutejs/plasma-tokens-b2c@0.67.0-canary.2814.26576874879.0
npm install @salutejs/plasma-tokens-web@1.71.0-canary.2814.26576874879.0
npm install @salutejs/plasma-tokens@1.140.0-canary.2814.26576874879.0
npm install @salutejs/plasma-typo@0.44.0-canary.2814.26576874879.0
npm install @salutejs/plasma-ui@1.350.0-canary.2814.26576874879.0
npm install @salutejs/plasma-web@1.622.0-canary.2814.26576874879.0
npm install @salutejs/sdds-bizcom@0.352.0-canary.2814.26576874879.0
npm install @salutejs/sdds-cs@0.356.0-canary.2814.26576874879.0
npm install @salutejs/sdds-dfa@0.350.0-canary.2814.26576874879.0
npm install @salutejs/sdds-finai@0.343.0-canary.2814.26576874879.0
npm install @salutejs/sdds-insol@0.347.0-canary.2814.26576874879.0
npm install @salutejs/sdds-netology@0.351.0-canary.2814.26576874879.0
npm install @salutejs/sdds-os@0.22.0-canary.2814.26576874879.0
npm install @salutejs/sdds-platform-ai@0.351.0-canary.2814.26576874879.0
npm install @salutejs/sdds-sbcom@0.352.0-canary.2814.26576874879.0
npm install @salutejs/sdds-scan@0.350.0-canary.2814.26576874879.0
npm install @salutejs/sdds-serv@0.351.0-canary.2814.26576874879.0
npm install @salutejs/core-themes@0.31.0-canary.2814.26576874879.0
npm install @salutejs/plasma-themes@0.52.0-canary.2814.26576874879.0
npm install @salutejs/sdds-themes@0.67.0-canary.2814.26576874879.0
npm install @salutejs/sdds-api-tests@0.9.0-canary.2814.26576874879.0
npm install @salutejs/plasma-cy-utils@0.158.0-canary.2814.26576874879.0
npm install @salutejs/plasma-sb-utils@0.228.0-canary.2814.26576874879.0
npm install @salutejs/plasma-tokens-utils@0.52.0-canary.2814.26576874879.0
# or 
yarn add @salutejs/plasma-asdk@0.378.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-b2c@1.620.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-core@1.228.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-giga@0.347.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-homeds@0.347.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-hope@1.374.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-icons@1.239.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-new-hope@0.364.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-tokens-b2b@1.56.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-tokens-b2c@0.67.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-tokens-web@1.71.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-tokens@1.140.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-typo@0.44.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-ui@1.350.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-web@1.622.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-bizcom@0.352.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-cs@0.356.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-dfa@0.350.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-finai@0.343.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-insol@0.347.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-netology@0.351.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-os@0.22.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-platform-ai@0.351.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-sbcom@0.352.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-scan@0.350.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-serv@0.351.0-canary.2814.26576874879.0
yarn add @salutejs/core-themes@0.31.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-themes@0.52.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-themes@0.67.0-canary.2814.26576874879.0
yarn add @salutejs/sdds-api-tests@0.9.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-cy-utils@0.158.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-sb-utils@0.228.0-canary.2814.26576874879.0
yarn add @salutejs/plasma-tokens-utils@0.52.0-canary.2814.26576874879.0

Summary by CodeRabbit

  • New Features

    • Added support for independent start/end date selection in DatePickerRange with automatic "smart swap" behavior when dates are entered in reverse order.
    • Enhanced date range restriction using min, max, and includeEdgeDates with improved millisecond-precision boundary handling.
  • Documentation

    • Updated DatePickerRange documentation across all sites with examples for independent date selection and date range restriction.
  • Tests

    • Added test cases for DatePickerRange interactions and accessibility scenarios.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

DatePickerRange adds independent single-date selection via an onChangeSingleValue callback throughout the Calendar component tree, normalized date bounds with millisecond precision to prevent time components from affecting day selection, updated range orchestration logic for special text-field-first scenarios, and comprehensive test coverage and documentation across all platform doc sites.

Changes

DatePickerRange Single-Value Selection and Smart Bounds

Layer / File(s) Summary
Calendar type contract and single-value HOC handling
packages/plasma-new-hope/src/components/Calendar/Calendar.types.ts, packages/plasma-new-hope/src/components/Calendar/hoc/withRange.tsx
CalendarRange<T> type adds optional onChangeSingleValue callback; withRange HOC destructures it and conditionally invokes it on first-selection (no startValue yet) instead of calling the full range handler. Dependency list updated to include both callback and startValue.
Calendar date bounds normalization for day selection
packages/plasma-new-hope/src/components/Calendar/CalendarBase/CalendarBase.tsx, packages/plasma-new-hope/src/components/Calendar/CalendarDouble/CalendarDouble.tsx
Min/max date boundaries normalized with millisecond precision: min set to 00:00:00.000 and max set to 23:59:59.999 to ensure time components do not affect day-level availability checks.
RangeDatePopover type and calendar wiring
packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.ts, packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.tsx
RangeDatePopoverProps adds optional onChangeSingleValue callback prop; component destructures and forwards it to both double-calendar and single-calendar rendering paths.
RangeDate orchestration of single-value selection
packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDate.tsx
Locale initialization moved into handleChangeStartOfRange; new special-case handling routes selection to second picker when first date unset but second field clicked and focuses first input; new handleCalendarSingleValueChange handler routes single selections to appropriate field and shifts focus to opposite input; RangeDatePopover wired with handler.
Component tests and template documentation
packages/plasma-new-hope/src/components/DatePicker/DatePicker.component-test.tsx, packages/plasma-new-hope/src/components/DatePicker/DatePicker.template-doc.mdx
Four new Cypress tests cover second-date-first selection, range completion, smart swap ordering, and edge-date accessibility with time-based bounds. Template docs explain independent date selection, smart swap behavior, and range limitation via min/max/includeEdgeDates with code examples.
Storybook utilities date defaults update
utils/plasma-sb-utils/src/components/DatePicker/meta.ts
Storybook meta defaults changed: min now uses new Date() instead of fixed 2024 date; max and renderFromDate defaults removed while keeping closeAfterDateSelect and includeEdgeDates enabled.
Documentation across all doc sites
website/plasma-*/docs/components/DatePicker.mdx (×13 sites)
All doc site versions receive consistent 54-line additions with two new sections: independent start/end date selection with smart swap behavior and focus transfer, plus date range restriction using min/max/includeEdgeDates, each with live code examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • neretin-trike
  • shuga2704

Poem

🐰 A rabbit hops through date fields with glee,
Single values flow, or ranges align naturally,
Bounds snap to midnight, no time to delay,
Smart swaps shuffle when dates lead astray,
Docs bloom on every site—hopping all the way! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: making DatePickerRange inputs independent, which is the core objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PLASMA-7233

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


Comment @coderabbitai help to get the list of available commands and usage tips.

@TitanKuzmich TitanKuzmich changed the title PLASMA-7233: make DatePickerRange inouts independent PLASMA-7233: make DatePickerRange inputs independent May 28, 2026
@TitanKuzmich TitanKuzmich requested a review from IgorYar May 28, 2026 11:43
@github-actions
Copy link
Copy Markdown
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-2814/

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Documentation preview deployed!

website: https://plasma.sberdevices.ru/pr/pr-2814/
asdk storybook: https://plasma.sberdevices.ru/pr/pr-2814/asdk-storybook/
b2c storybook: https://plasma.sberdevices.ru/pr/pr-2814/b2c-storybook/
giga storybook: https://plasma.sberdevices.ru/pr/pr-2814/giga-storybook/
homeds storybook: https://plasma.sberdevices.ru/pr/pr-2814/homeds-storybook/
new-hope storybook: https://plasma.sberdevices.ru/pr/pr-2814/new-hope-storybook/
ui storybook: https://plasma.sberdevices.ru/pr/pr-2814/ui-storybook/
web storybook: https://plasma.sberdevices.ru/pr/pr-2814/web-storybook/
sdds-bizcom storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-bizcom-storybook/
sdds-cs storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-cs-storybook/
sdds-dfa storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-dfa-storybook/
sdds-finai storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-finai-storybook/
sdds-insol storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-insol-storybook/
sdds-netology storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-netology-storybook/
sdds-os storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-os-storybook/
sdds-platform-ai storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-platform-ai-storybook/
sdds-sbcom storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-sbcom-storybook/
sdds-scan storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-scan-storybook/
sdds-serv storybook: https://plasma.sberdevices.ru/pr/pr-2814/sdds-serv-storybook/

Copy link
Copy Markdown

@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: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plasma-new-hope/src/components/Calendar/hoc/withRange.tsx`:
- Around line 49-53: The current else branch only calls onChangeSingleValue and
drops onChangeValue when onChangeSingleValue is undefined; change the logic so
that when startValue is falsy you call onChangeSingleValue if provided,
otherwise fall back to onChangeValue so existing range consumers still receive
updates—specifically update the block around startValue to: if (startValue) call
onChangeValue([first, second], dateInfo); else if (onChangeSingleValue) call
onChangeSingleValue(newDay, dateInfo); else call onChangeValue([newDay, newDay],
dateInfo) (use the symbols onChangeValue, onChangeSingleValue, startValue,
newDay, first, second, dateInfo to locate the code).

In `@website/sdds-insol-docs/docs/components/DatePicker.mdx`:
- Around line 849-850: The current nextMonth calculation overflows when the
current day doesn't exist in the following month (e.g., Jan 31 -> Mar 1). Update
the logic around the today and nextMonth variables to clamp the day to the last
day of the next month: compute the last day of the month after next (using new
Date(today.getFullYear(), today.getMonth() + 2, 0)) to get the maximum day, then
set nextMonth's day to Math.min(today.getDate(), thatLastDay) so nextMonth
becomes the same day or the month’s last day instead of overflowing;
alternatively, for docs simplicity, use a fixed-day offset from today.

In `@website/sdds-netology-docs/docs/components/DatePicker.mdx`:
- Around line 849-850: The current nextMonth calculation overflows when the next
month has fewer days (e.g., Jan 31 → Mar 3); replace the simple new
Date(today.getFullYear(), today.getMonth() + 1, today.getDate()) with a
capped-day approach: compute daysInNextMonth = new Date(today.getFullYear(),
today.getMonth() + 2, 0).getDate() and set nextMonth = new
Date(today.getFullYear(), today.getMonth() + 1, Math.min(today.getDate(),
daysInNextMonth)); this keeps the same day when possible and uses the last day
of the next month when the current day would overflow (variables: today,
nextMonth, daysInNextMonth).

In `@website/sdds-platform-ai-docs/docs/components/DatePicker.mdx`:
- Around line 849-850: The current nextMonth calculation using new
Date(today.getFullYear(), today.getMonth() + 1, today.getDate()) can overflow
when the same day doesn't exist in the next month (e.g., Jan 31 -> Mar 1);
update the nextMonth logic to clamp the day to the last day of the target month
by computing the number of days in the next month and using
Math.min(today.getDate(), daysInNextMonth) when constructing nextMonth
(referencing the today and nextMonth variables in DatePicker.mdx). This ensures
nextMonth becomes the last day of the next month when the current day is too
large; alternatively, for docs simplicity you can use a fixed day offset like
adding 30 days to today.

In `@website/sdds-scan-docs/docs/components/DatePicker.mdx`:
- Around line 754-755: The current nextMonth calculation (using today and
nextMonth) can overflow when the current day doesn’t exist in the following
month (e.g., Jan 31 → Mar 3); replace it with a safe calculation that clamps to
the last day of the next month by constructing the date using month+2 with day 0
(or otherwise compute the last day of the next month) so nextMonth always yields
the last valid date in the next month instead of rolling into the following
month.

In `@website/sdds-serv-docs/docs/components/DatePicker.mdx`:
- Around line 849-850: The current nextMonth calculation (const today = new
Date(); const nextMonth = new Date(today.getFullYear(), today.getMonth() + 1,
today.getDate());) can overflow when the same day doesn't exist in the next
month (e.g., Jan 31 → Mar 1); fix it by capping the day to the last day of the
target month: compute the number of days in the next month (e.g., by using a
Date trick to get the last day: new Date(year, month+2, 0)) and set nextMonth's
day to Math.min(today.getDate(), daysInNextMonth) so nextMonth becomes the
correct last day (e.g., June 30) instead of rolling into the following month.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 648e432f-d851-4707-b5af-fbafd3cc3dc9

📥 Commits

Reviewing files that changed from the base of the PR and between fcfe644 and 10084ac.

⛔ Files ignored due to path filters (70)
  • cypress/snapshots/cs/chromium/DatePicker/DatePicker -- disabled, readOnly.snap.png is excluded by !**/*.png
  • cypress/snapshots/cs/webkit/DatePicker/DatePicker -- disabled, readOnly.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select day in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select month by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select month in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select year by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select year in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- case very future date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- defaultDate, enableContentLeft, enableContentRight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input date from calendar.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input masked date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=l.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=m.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=s.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=xs.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- view=default, size=xl.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, firstValueError, secondValueError.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, firstValueSuccess, secondValueSuccess.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, hasClearDivider.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- defaultDate, enableContent.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- hintText, required, requiredPlacement=right.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select day in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select month by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select month in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select year by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select year in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- case very future date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- defaultDate, enableContentLeft, enableContentRight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input date from calendar.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input masked date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=l.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=m.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=s.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=xs.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- view=default, size=xl.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, firstValueError, secondValueError.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, firstValueSuccess, secondValueSuccess.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, hasClearDivider.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- defaultDate, enableContent.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- hintText, required, requiredPlacement=right.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- stretch.snap.png is excluded by !**/*.png
📒 Files selected for processing (21)
  • packages/plasma-new-hope/src/components/Calendar/Calendar.types.ts
  • packages/plasma-new-hope/src/components/Calendar/hoc/withRange.tsx
  • packages/plasma-new-hope/src/components/Calendar/utils/getDateWithModification.ts
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.component-test.tsx
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.template-doc.mdx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDate.tsx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.tsx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.ts
  • website/plasma-b2c-docs/docs/components/DatePicker.mdx
  • website/plasma-giga-docs/docs/components/DatePicker.mdx
  • website/plasma-homeds-docs/docs/components/DatePicker.mdx
  • website/plasma-web-docs/docs/components/DatePicker.mdx
  • website/sdds-bizcom-docs/docs/components/DatePicker.mdx
  • website/sdds-cs-docs/docs/components/DatePicker.mdx
  • website/sdds-dfa-docs/docs/components/DatePicker.mdx
  • website/sdds-finai-docs/docs/components/DatePicker.mdx
  • website/sdds-insol-docs/docs/components/DatePicker.mdx
  • website/sdds-netology-docs/docs/components/DatePicker.mdx
  • website/sdds-platform-ai-docs/docs/components/DatePicker.mdx
  • website/sdds-scan-docs/docs/components/DatePicker.mdx
  • website/sdds-serv-docs/docs/components/DatePicker.mdx

Comment thread packages/plasma-new-hope/src/components/Calendar/hoc/withRange.tsx
Comment thread website/sdds-insol-docs/docs/components/DatePicker.mdx
Comment thread website/sdds-netology-docs/docs/components/DatePicker.mdx
Comment thread website/sdds-platform-ai-docs/docs/components/DatePicker.mdx
Comment thread website/sdds-scan-docs/docs/components/DatePicker.mdx
Comment thread website/sdds-serv-docs/docs/components/DatePicker.mdx
Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
utils/plasma-sb-utils/src/components/DatePicker/meta.ts (1)

38-38: ⚡ Quick win

Normalize Storybook min to start-of-day.

min: new Date() includes the current time, which can make day-level demos behave inconsistently during the day. Prefer a date-only boundary.

Suggested change
-    min: new Date(),
+    min: new Date(new Date().setHours(0, 0, 0, 0)),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@utils/plasma-sb-utils/src/components/DatePicker/meta.ts` at line 38, The
Storybook story sets min: new Date(), which captures the current time and can
make day-level demos inconsistent; update the min property in meta.ts to a
normalized start-of-day date (e.g., construct a Date at 00:00:00 for today) so
the boundary is date-only; locate the min property in the exported story meta
(the min field) and replace new Date() with a start-of-day Date (using
Date#setHours(0,0,0,0) or a shared startOfDay helper) to ensure deterministic
day-level behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@utils/plasma-sb-utils/src/components/DatePicker/meta.ts`:
- Line 38: The Storybook story sets min: new Date(), which captures the current
time and can make day-level demos inconsistent; update the min property in
meta.ts to a normalized start-of-day date (e.g., construct a Date at 00:00:00
for today) so the boundary is date-only; locate the min property in the exported
story meta (the min field) and replace new Date() with a start-of-day Date
(using Date#setHours(0,0,0,0) or a shared startOfDay helper) to ensure
deterministic day-level behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e183e6d-3517-49ac-8913-5592b4d5edab

📥 Commits

Reviewing files that changed from the base of the PR and between 10084ac and cc70daf.

⛔ Files ignored due to path filters (70)
  • cypress/snapshots/cs/chromium/DatePicker/DatePicker -- disabled, readOnly.snap.png is excluded by !**/*.png
  • cypress/snapshots/cs/webkit/DatePicker/DatePicker -- disabled, readOnly.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select day in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select month by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select month in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select year by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- DatePicker select year in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- case very future date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- defaultDate, enableContentLeft, enableContentRight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input date from calendar.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- input masked date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=l.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=m.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=s.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- size=xs.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePicker -- view=default, size=xl.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, firstValueError, secondValueError.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, firstValueSuccess, secondValueSuccess.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- appearance=clear, hasClearDivider.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- defaultDate, enableContent.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- hintText, required, requiredPlacement=right.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/chromium/DatePicker/DatePickerRange -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select day in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select month by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select month in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select year by arrows.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- DatePicker select year in popover.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- case very future date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- defaultDate, enableContentLeft, enableContentRight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input date from calendar.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- input masked date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=l.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=m.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=s.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- size=xs.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- stretch.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePicker -- view=default, size=xl.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, firstValueError, secondValueError.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, firstValueSuccess, secondValueSuccess.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- appearance=clear, hasClearDivider.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- calendarContainerWidth, calendarContainerHeight.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- controlled datepicker reset date.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=left, dateShortcutsWidth=5rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- dateShortcuts, dateShortcutsPlacement=right, dateShortcutsWidth=10rem.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- defaultDate, enableContent.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- hintText, required, requiredPlacement=right.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- label, leftHelper, placeholder.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- renderFromDate.snap.png is excluded by !**/*.png
  • cypress/snapshots/homeds/webkit/DatePicker/DatePickerRange -- stretch.snap.png is excluded by !**/*.png
📒 Files selected for processing (23)
  • packages/plasma-new-hope/src/components/Calendar/Calendar.types.ts
  • packages/plasma-new-hope/src/components/Calendar/CalendarBase/CalendarBase.tsx
  • packages/plasma-new-hope/src/components/Calendar/CalendarDouble/CalendarDouble.tsx
  • packages/plasma-new-hope/src/components/Calendar/hoc/withRange.tsx
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.component-test.tsx
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.template-doc.mdx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDate.tsx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.tsx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.ts
  • utils/plasma-sb-utils/src/components/DatePicker/meta.ts
  • website/plasma-b2c-docs/docs/components/DatePicker.mdx
  • website/plasma-giga-docs/docs/components/DatePicker.mdx
  • website/plasma-homeds-docs/docs/components/DatePicker.mdx
  • website/plasma-web-docs/docs/components/DatePicker.mdx
  • website/sdds-bizcom-docs/docs/components/DatePicker.mdx
  • website/sdds-cs-docs/docs/components/DatePicker.mdx
  • website/sdds-dfa-docs/docs/components/DatePicker.mdx
  • website/sdds-finai-docs/docs/components/DatePicker.mdx
  • website/sdds-insol-docs/docs/components/DatePicker.mdx
  • website/sdds-netology-docs/docs/components/DatePicker.mdx
  • website/sdds-platform-ai-docs/docs/components/DatePicker.mdx
  • website/sdds-scan-docs/docs/components/DatePicker.mdx
  • website/sdds-serv-docs/docs/components/DatePicker.mdx
✅ Files skipped from review due to trivial changes (12)
  • packages/plasma-new-hope/src/components/Calendar/CalendarDouble/CalendarDouble.tsx
  • website/sdds-insol-docs/docs/components/DatePicker.mdx
  • website/plasma-giga-docs/docs/components/DatePicker.mdx
  • website/plasma-web-docs/docs/components/DatePicker.mdx
  • website/sdds-scan-docs/docs/components/DatePicker.mdx
  • website/sdds-finai-docs/docs/components/DatePicker.mdx
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.template-doc.mdx
  • website/sdds-dfa-docs/docs/components/DatePicker.mdx
  • website/plasma-b2c-docs/docs/components/DatePicker.mdx
  • website/plasma-homeds-docs/docs/components/DatePicker.mdx
  • website/sdds-cs-docs/docs/components/DatePicker.mdx
  • website/sdds-serv-docs/docs/components/DatePicker.mdx
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.ts
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.tsx
  • website/sdds-netology-docs/docs/components/DatePicker.mdx
  • website/sdds-platform-ai-docs/docs/components/DatePicker.mdx
  • packages/plasma-new-hope/src/components/DatePicker/DatePicker.component-test.tsx
  • packages/plasma-new-hope/src/components/DatePicker/RangeDate/RangeDate.tsx

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.

1 participant