primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Calendar - add option to change step size in yearpicker

Open bjuergens opened this issue 9 months ago • 0 comments

In the calendar-widget, it is possible to select a year via yearpicker. This yearpicker always shows an entire decade. Also the yearpicker is much smaller than the other parts of the caledner (e.g. daypicker, monthpicker), so the yearpicker has some room for growth (in size). The "small" yearpicker size, is a problem, when you select dates, that are far away from the current year (e.g. birthdays).

I propose two things:

  • add an option to change the number of years displayed for the yearpicker
  • change the default from 10 to 20 years

I implemented it in the PR, where I also posted some screenshots.

Comparison to material-datepicker:

the calendar tool in material-design has a stepsize of 24 for the year picker. This has the benefit, that you need to click less. It has the downside, that 24 is not a multiple of 10, and there for the years "jump around" when you make a step in the yearpicker, which makes it a little annoying to use.

The material-datepicker has 4 columns, which I think

related discussion: https://github.com/orgs/primefaces/discussions/1780

related PR: https://github.com/primefaces/primeng/pull/15419

bjuergens avatar May 21 '24 07:05 bjuergens