-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[docs] Refactor Pickers Localization
documentation sections
#11989
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ca601f2
Fix typos
LukasTy 022cc9f
Add missing `pages` word
LukasTy 97c776d
Make `DateField` doc consistent and link to `custom formats`
LukasTy 12742da
Move locaization before validation section for consistency
LukasTy 4282441
Make `TimeField` doc consistent and link to `custom formats`
LukasTy e181882
Add missing localization sections to `clocks` pages
LukasTy 8f8c5d0
Make `DateTimeField` doc consistent and link to `custom formats`
LukasTy fb4f604
Consistent localization section on date range components pages
LukasTy 4167b1f
Consistent sections on `time-range-field`
LukasTy 2c3716f
Consistent sections on `date-time-range` components
LukasTy 89bc018
Consistent `Validation` section text
LukasTy 5fbd094
Simplify `Localization` section copyright
LukasTy e66689f
docs:typescript:formatted
LukasTy 7f57fac
Make `customize the format` section a sub-section of `Localization`
LukasTy 563d387
Code review: Sam
LukasTy 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
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
6 changes: 2 additions & 4 deletions
6
docs/data/date-pickers/date-field/CustomDateFormat.tsx.preview
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<DateField | ||
label="Dash separator" | ||
value={value} | ||
onChange={(newValue) => setValue(newValue)} | ||
defaultValue={dayjs('2022-04-17')} | ||
format="MM-DD-YYYY" | ||
/> | ||
<DateField | ||
label="Full letter month" | ||
value={value} | ||
onChange={(newValue) => setValue(newValue)} | ||
defaultValue={dayjs('2022-04-17')} | ||
format="LL" | ||
/> |
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
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
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
13 changes: 4 additions & 9 deletions
13
docs/data/date-pickers/date-time-field/CustomDateTimeFormat.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
15 changes: 15 additions & 0 deletions
15
docs/data/date-pickers/date-time-field/CustomDateTimeFormat.tsx.preview
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,15 @@ | ||
<DateTimeField | ||
label="Format with meridiem" | ||
defaultValue={dayjs('2022-04-17T15:30')} | ||
format="L hh:mm a" | ||
/> | ||
<DateTimeField | ||
label="Format without meridiem" | ||
defaultValue={dayjs('2022-04-17T15:30')} | ||
format="L HH:mm" | ||
/> | ||
<DateTimeField | ||
label="Localized format with full letter month" | ||
defaultValue={dayjs('2022-04-17T15:30')} | ||
format="LLL" | ||
/> |
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
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
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
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.
IMHO this demo should either not exist or be inside the "Localization" section below
THis would help people understand that the custom date format is part of the the Localization in our doc
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.
Initially, I was leaning towards that direction, but then I thought that the various custom formats for different components (date, time, and date-time) have lots of examples. If we want to provide at least a similar amount of demos in the
Custom format
section, it would be huge. 🤯That's why I decided to keep the separate section. 🤔
WDYT?
Would moving those
Customize the <x> format
sections as sub-sections ofLocalization
make more sense to you?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.
@flaviendelangle I've moved the
Customize the format
sections as subsections ofLocalization
.Let me know what you think. 😉
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.
I can be a good trade-off 👌
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 can be a great use-case for a switch like github does it on their webhook documentation:
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.
In the sense that you could provide a few options to select formats and then the fields will use that. WDYT?
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.
That is a great suggestion, I'll explore that option. 👌
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.
@michelengelen I've explored that possibility but felt that the increased complexity and worse demo code readability didn't help. 🤔
If we wanted it to be useful, we'd need to have an elaborate demo with code preview. 🙈
I think that for starters this improvement should be useful enough. 🤞