-
Notifications
You must be signed in to change notification settings - Fork 162
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
dpitcock
wants to merge
46
commits into
main
Choose a base branch
from
denpitco-monthly-range-picker2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
c6e45a2
feat: Month granularity in date-range-picker
dpitcock a5cde6e
setting relative options to start with Last vs Previous
dpitcock be09560
fixing calendar util to focus month
dpitcock 29e4739
fixing auto calendar update after startdate entered
dpitcock 1b2ea82
creating test-classes dir for date-range-picker and updating test uti…
dpitcock 63eb37e
updating snapshot after rebase
dpitcock e761cfe
fixing test and odd user select on calendar header button click
dpitcock b978990
expanding unit test covering for date-range-picker
dpitcock 4b85962
updating i18n strings and tests
dpitcock 0cda3e6
adding test to confirm i18n strings
dpitcock 829b6ad
updating i18n to have different constraint texts
dpitcock f71f85f
updaing i18n strings to use 'i18nStrings.' prefix
dpitcock 402401a
fixing test to also use 'i18nStrings.' prefix
dpitcock 93cd494
changes after applying changes from running script in i18n package
dpitcock 7e7d8c1
removing user-select styling addition
dpitcock 15fea17
test updates
dpitcock 5907acd
updating test utils
dpitcock daf0663
updating i18n string for relative range option desc
dpitcock f635cec
upating test
dpitcock 2a100a4
fixing integ test
dpitcock 0d8816e
implementing strategy pattern for grid item
dpitcock 21bf62a
modifying strategy on grid
dpitcock 02489b4
updaing relativeRangeSelectionMonthlyDescription
dpitcock 8dd4a5b
updating Granularity type
dpitcock 449875f
updating snapshot and Granularity type
dpitcock d5a41e1
updating after running i18n script
dpitcock 8fc8bff
preparing for merge
dpitcock 44f9394
preparing for merge2
dpitcock 45e1569
fixes after merging in latest calendar with 6 rows
dpitcock 2046db6
returning year calendar functions to not use selected in consideratio…
dpitcock 959755a
removing commented out code
dpitcock bf6a96e
renaming to monthly-grid so file is tracked correctly
dpitcock f087079
trying to rename file so it is tracked correctly
dpitcock 29838c3
fixing accessibility in page issues
dpitcock 0b879f6
adding more labels to DRP pages, addressing comments
dpitcock cae5883
adding validation functions so examples work on par with playground e…
dpitcock 56e2f76
adding month only custom absolute range to page
dpitcock 2fd7684
wrapping pages in Box component
dpitcock dd7f5e9
seperate permutations pages for month and year calendars
dpitcock fb977d4
fixing .no-range styling issue, seperating permutations
dpitcock 0970ec5
fixing disabled dates
dpitcock a7053d5
removed debug data-permutation in page
dpitcock 115108d
chore: Cleaning up classes
dpitcock 2f29638
chore: Cleaning up classes2
dpitcock bc106f8
chore: Cleaning up classes3
dpitcock 91cd9c3
returning class to day-header
dpitcock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
68 changes: 68 additions & 0 deletions
68
pages/date-range-picker/absolute-format-month-picker.permutations.page.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CR-175152623 is changes needed to add regression tests path |
||
// SPDX-License-Identifier: Apache-2.0 | ||
import React from 'react'; | ||
|
||
import { Box, DateRangePicker, DateRangePickerProps, SpaceBetween } from '~components'; | ||
|
||
import createPermutations from '../utils/permutations'; | ||
import PermutationsView from '../utils/permutations-view'; | ||
import ScreenshotArea from '../utils/screenshot-area'; | ||
import { generatePlaceholder, i18nStrings, isValid } from './common'; | ||
|
||
const permutations = createPermutations< | ||
Pick<DateRangePickerProps, 'absoluteFormat' | 'dateOnly' | 'hideTimeOffset' | 'value' | 'granularity'> | ||
>([ | ||
{ | ||
absoluteFormat: ['iso', 'long-localized'], | ||
value: [ | ||
{ | ||
type: 'absolute', | ||
startDate: '2024-12', | ||
endDate: '2025-01', | ||
}, | ||
], | ||
}, | ||
{ | ||
absoluteFormat: ['iso', 'long-localized'], | ||
hideTimeOffset: [true, false], | ||
value: [ | ||
{ | ||
type: 'absolute', | ||
startDate: '2023-06', | ||
endDate: '2024-02', | ||
}, | ||
], | ||
}, | ||
]); | ||
|
||
export default function DateRangePickerPermutations() { | ||
return ( | ||
<Box padding="s"> | ||
<SpaceBetween direction="vertical" size="m"> | ||
<h1>Absolute date range picker year calendar with custom absolute format</h1> | ||
<hr /> | ||
<ScreenshotArea> | ||
<PermutationsView | ||
permutations={permutations} | ||
render={permutation => ( | ||
<DateRangePicker | ||
value={permutation.value} | ||
absoluteFormat={permutation.absoluteFormat} | ||
dateOnly={false} | ||
granularity="month" | ||
hideTimeOffset={permutation.hideTimeOffset} | ||
locale="en-US" | ||
i18nStrings={i18nStrings} | ||
placeholder={generatePlaceholder(permutation.dateOnly, permutation.granularity === 'month')} | ||
relativeOptions={[]} | ||
isValidRange={value => isValid('month')(value)} | ||
rangeSelectorMode={'absolute-only'} | ||
getTimeOffset={() => 60} | ||
/> | ||
)} | ||
/> | ||
</ScreenshotArea> | ||
</SpaceBetween> | ||
</Box> | ||
); | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR-175152623 is changes needed to accommodate regression tests path change