-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(module: datepicker): add 12-hour time support #2501
feat(module: datepicker): add 12-hour time support #2501
Conversation
Codecov Report
@@ Coverage Diff @@
## feature #2501 +/- ##
===========================================
+ Coverage 27.67% 29.37% +1.69%
===========================================
Files 498 535 +37
Lines 33508 25851 -7657
Branches 0 258 +258
===========================================
- Hits 9275 7595 -1680
+ Misses 24233 18216 -6017
- Partials 0 40 +40
Continue to review full report at Codecov.
|
Thanks for contribute this @Alexbits , this make a great help! In terms of globalization, I think AM and PM can use . NET built-in string for the current culture as the fallback.
|
Thank you for your work @ElderJames ! I thought about this, but I was unsure if it was worth it since you provided the strings in the DateLocale class. Where do you mean to implement this fallback? |
Hi @ElderJames, I checked the original ant.design, and AM/PM in the selection panel is not localized 馃 Also, in the ant-design-blazor the selection panel does not look right when AM/PM localized with the scrollbar visible: |
That's fine. We may need to modify the style to make the width adaptive. |
Co-authored-by: James Yeung <shunjiey@hotmail.com>
Fixed. Sorry! I've missed this somehow. |
I'm considering implementing (separate PR) the time selection behavior as it is in the ant-design. When the OK button is present, the value is not applied until the OK button or Enter key is used to confirm it. Then it makes sense to have the OK button. What do you think about this @ElderJames? |
Good idea. We just want to follow antd's behavior, and we also need to give the user the option to update the value when the panel is closed |
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.
LGTM. Thanks.
Fixed |
I also see another issue with the TimePicker. The selected time is often not visible. The TimePicker should auto-scroll itself when the selected value is not visible. 馃 |
Yes, antd is designed to scroll to the top when time item clicked. We're not there yet. Do you have any ideas? |
I'm looking into it. |
* feat(module: datepicker): add 12-hour time support * fix(module: datepicker): revert 24-hour time format * fix(module: datepicker): AM/PM not localized in the date input component * fix(module: datepicker): AM/PM in the selection panel are not localized * Update components/date-picker/internal/DatePickerDatetimePanel.razor Co-authored-by: James Yeung <shunjiey@hotmail.com> * fix(module: datepicker). AM/PM switches toggling incorrectly * fix(module: datepicker): 24-hour format in DatePicker when Use12Hours * fix(module: datepicker): time format in docs * refactor(module: datepicker): code cleanup * feat(module: datepicker): add 12-hour format to en-US locale
Add 12-hour time support to the DatePicker/TimePicker/RangePicker
馃 This is a ...
馃敆 Related issue link
馃挕 Background and solution
馃摑 Changelog
鈽戯笍 Self Check before Merge