Skip to content
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

feat: Month granularity for date-range-picker #3077

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

dpitcock
Copy link
Member

@dpitcock dpitcock commented Nov 29, 2024

Month granularity for date-range-picker

The Date Picker component has a granularity prop that can be set to "month" which disallows the selection of day and allows the selection of month. This functionality is now being extended onto Date Range Picker component, so it will also support month range selection

issues: [AWSUI-18630, AWSUI-20124, AWSUI-8139]

Previous PRs for this project

How has this been tested?

test coverage expanded to include both unit tests and integration tests for the DateRangePicker component utilizing the 'month' granularity setting. These tests now encompass rendered iterations of the components, ensuring comprehensive validation of this specific functionality.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 97.53695% with 10 lines in your changes missing coverage. Please review.

Project coverage is 96.47%. Comparing base (c1a6f63) to head (91cd9c3).

Files with missing lines Patch % Lines
src/date-range-picker/calendar/grids/index.tsx 90.62% 3 Missing ⚠️
src/date-range-picker/calendar/grids/grid.tsx 97.89% 2 Missing ⚠️
src/date-range-picker/calendar/header/index.tsx 91.66% 1 Missing ⚠️
src/date-range-picker/calendar/index.tsx 97.43% 1 Missing ⚠️
src/date-range-picker/calendar/range-inputs.tsx 95.65% 1 Missing ⚠️
src/date-range-picker/dropdown.tsx 83.33% 1 Missing ⚠️
src/date-range-picker/relative-range/index.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3077      +/-   ##
==========================================
+ Coverage   96.45%   96.47%   +0.01%     
==========================================
  Files         790      791       +1     
  Lines       22294    22534     +240     
  Branches     7667     7793     +126     
==========================================
+ Hits        21504    21739     +235     
- Misses        738      743       +5     
  Partials       52       52              

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

@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch from 7491fa5 to 7f28657 Compare December 3, 2024 09:26
@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch 3 times, most recently from e8bd8f5 to f61d398 Compare December 11, 2024 00:52
@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch from f61d398 to 74458ef Compare December 11, 2024 08:51
@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch from 74458ef to 73641df Compare December 11, 2024 10:19
@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch from d63e7be to 24aba24 Compare December 11, 2024 13:58
@dpitcock dpitcock force-pushed the denpitco-monthly-range-picker2 branch from 24aba24 to 0773794 Compare December 11, 2024 14:22
@dpitcock dpitcock marked this pull request as ready for review December 11, 2024 14:41
@dpitcock dpitcock requested a review from a team as a code owner December 11, 2024 14:41
@dpitcock dpitcock requested review from just-boris and removed request for a team December 11, 2024 14:41
src/i18n/messages-types.ts Outdated Show resolved Hide resolved
Comment on lines +12 to +13
import startOfYear from 'date-fns/startOfYear';
import sub from 'date-fns/sub';
Copy link
Member

Choose a reason for hiding this comment

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

related to this PR: #3240

it will probably break after another rebase

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.

4 participants