ng-zorro-antd
ng-zorro-antd copied to clipboard
fix(module:calendar): year dropdown update issue when date is changed programmatically
PR Checklist
Please check if your PR fulfills the following requirements:
- [✔] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
[✔] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:
What is the current behavior?
The year dropdown in the calendar works as follows: • It displays the years within a 10-year range of the selected year. • For example, if the selected year is 2015, the year dropdown shows the years from 2005 to 2024.
The bug is that the year dropdown does not update when the date is changed programmatically. • For instance, if the selected year is 2005, the year dropdown shows the years from 1995 to 2014. If the date is changed programmatically to today, the selected year is 2023, but the year dropdown still shows the years from 1995 to 2014. This results in an empty year dropdown. • This issue also occurs if the initial date of the calendar is set to more than 10 years ago. (For example, in the basic usage of the calendar, the initial date's year is 2012, but the year dropdown does not include 2012, so it is shown as blank.)
Issue Number: #8284
What is the new behavior?
• The year dropdown is updated when the date is changed programmatically to a different year.
Does this PR introduce a breaking change?
[ ] Yes
[✔] No
Other information
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.57%. Comparing base (
9bcce6c
) to head (b534438
).
Additional details and impacted files
@@ Coverage Diff @@
## master #8286 +/- ##
=======================================
Coverage 91.57% 91.57%
=======================================
Files 533 533
Lines 18331 18337 +6
Branches 2798 2800 +2
=======================================
+ Hits 16787 16793 +6
Misses 1226 1226
Partials 318 318
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LGTM