-
Notifications
You must be signed in to change notification settings - Fork 106
feat(date-picker): add pf-date-picker #2599
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
Draft
ArathyKumar
wants to merge
19
commits into
patternfly:main
Choose a base branch
from
ArathyKumar:feature/pf-date-picker
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.
Draft
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ad5106e
feat: add pf-date-picker
2b0ff7d
chore: added date picker component
690a889
Merge branch 'main' into feature/pf-date-picker
ArathyKumar 832d1f6
Merge branch 'main' into feature/pf-date-picker
549822b
fix: code updated to work with pf-3
36f9aca
Merge branch 'patternfly:main' into feature/pf-date-picker
ArathyKumar 08820f3
fix: translation and popover fixes updated
19e0e11
chore: split large demo files to individual files
1ae65c5
fix: css fixes
52456d7
fix: button css fix on focus
0c94f75
chore: component image added
dde0275
fix: removed the date-picker child components from package.json
988447d
fix: added constants in the helper file
412b41d
fix: removed the constructor
543394f
fix: changed the format of DOM properties from camelCase to dash-case
80615e4
Merge remote-tracking branch 'origin/main' into feature/pf-date-picker
c04282e
chore: readme updated
9580ff1
fix: changed extend composedevent to event
e9e9833
fix: added ecmascript private variables
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
chore: readme updated
- Loading branch information
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,80 @@ | ||
| # Date Picker | ||
| Add a description of the component here. | ||
|
|
||
| The Date Picker component lets users choose dates within a set range defined by both a minimum and maximum date. This feature makes it easy for users to select dates that fall within the specified limits | ||
|
|
||
| ## Usage | ||
| Describe how best to use this web component along with best practices. | ||
|
|
||
| The date-picker component includes an input field for entering dates, a toggle for opening and closing the calendar, and a popup calendar interface for selecting dates. | ||
|
|
||
| ```html | ||
| <pf-date-picker> | ||
| <section> | ||
| <h2>Date Format</h2> | ||
| <pre><code><pf-date-picker date-format-input="YYYY-DD-MM"></pf-date-picker></code></pre> | ||
| <pf-date-picker date-format-input="YYYY-DD-MM"></pf-date-picker> | ||
| <p>The date picker supports the following 12 date formats:</p> | ||
| <p><span>'DD/MM/YYYY', 'MM/DD/YYYY', 'YYYY/MM/DD', 'YYYY/DD/MM', 'DD-MM-YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD', | ||
| 'YYYY-DD-MM', 'DD.MM.YYYY', 'MM.DD.YYYY', 'YYYY.MM.DD', 'YYYY.DD.MM'</span></p> | ||
| <p>The date format is set globally, independent of the user's locale. | ||
| This means that all users will see the same date format, regardless of their language or region.</p> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Set Input Date</h2> | ||
| <pre><code><pf-date-picker input-date=${new Date(2023, 0, 1)}></pf-date-picker></code></pre> | ||
| <!-- ***** The value for inputDate must be passed as **DATE TYPE** from parent component (Here the value is passed as string type | ||
| for demo purpose, as there are some restrictions for adding Date type value in .html file). --> | ||
| <pf-date-picker input-date="Sun Jan 01 2023 05:30:00 GMT+0530 (India Standard Time)"></pf-date-picker> | ||
| <p>The default date value can be passed to the date picker to set the initial date that is displayed.</p> | ||
| <p>In the above given example, the date set to be displayed initially is <span>January 1, 2023</span>.</p> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Disabled</h2> | ||
| <pre><code><pf-date-picker disabled="true"></pf-date-picker></code></pre> | ||
| <pf-date-picker disabled="true"></pf-date-picker> | ||
| <p>The <span>disabled</span> attribute can be used to disable the date picker.</p> | ||
| </section> | ||
|
|
||
| </pf-date-picker> | ||
| <section> | ||
| <h2>Localization</h2> | ||
| <pre><code><pf-date-picker localization-language-code="fi"></pf-date-picker></code></pre> | ||
| <pf-date-picker localization-language-code="fi"></pf-date-picker> | ||
| <p>The locale string can be passed to the date picker to set the date format.</p> | ||
| <p>In the above given example, the locale is set to <span>Finnish: fi</span></p> | ||
| <p>The date format is set globally, independent of the user's locale. | ||
| This means that all users will see the same date format, regardless of their language or region.</p> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Set minimum and maximum date range</h2> | ||
| <pre><code><pf-date-picker min-date=${new Date(2023, 0, 2)} max-date=${new Date(2023, 0, 20)} | ||
| inputDate=${new Date(2023, 0, 3)}></pf-date-picker></code></pre> | ||
| <!-- ***** The values for minDate and maxDate must be passed as **DATE TYPE** from parent component (Here the values are passed as string type | ||
| for demo purpose, as there are some restrictions for adding Date type value in .html file). --> | ||
| <pf-date-picker | ||
| inputDate="Tue Jan 03 2023 05:30:00 GMT+0530 (India Standard Time)" | ||
| min-date="Mon Jan 02 2023 00:00:00 GMT+0530 (India Standard Time)" | ||
| max-date="Fri Jan 20 2023 00:00:00 GMT+0530 (India Standard Time)"> | ||
| </pf-date-picker> | ||
| <p>The minimum and maximum valid dates can be passed to the date picker to restrict the range of dates that can be selected</p> | ||
| <p>In the above given example, the minimum valid date | ||
| is <span>January 2, 2023</span>, and the maximum valid date is <span>January 20, 2023</span></p> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Basic</h2> | ||
| <pre><code><pf-date-picker></pf-date-picker></code></pre> | ||
| <pf-date-picker></pf-date-picker> | ||
| <p>The basic date picker will use the user's locale to determine the date format. The default minimum valid date | ||
| is <span>January 1, 1900</span>, and the default maximum valid date is <span>December 31, 9999</span>.</p> | ||
| </section> | ||
|
|
||
| <section> | ||
| <h2>Translation</h2> | ||
| <pre><code><pf-date-picker translation-language-code="fr"></pf-date-picker></code></pre> | ||
| <pf-date-picker translation-language-code="fr"></pf-date-picker> | ||
| <p>The translation language string can be passed to the date picker to localize the month names.</p> | ||
| <p>In the above given example, the language is set to <span>French: fr</span></p> | ||
| </section> | ||
| ``` | ||
|
|
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.
this should be updated with prose from v4-archive.patternfly.org
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.
Updated README file