-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Datepicker - Tweak yearpicker layout by defining max years per row #3348
Comments
I think yearsPerRow is a reasonable step. |
I'm working on the yearsPerRow implementation. I have the actual feature implemented but only need to make the layout more dynamic now since the table header is hardcoded to a colspan of three columns. @karianna Are you the only one actively maintaining this repo / replying to issues? I see that there are more owners / contributors but don't see that many responding on new issues. |
Could also implement the {
yearGrid: '3x3'
} And use the result of the sum to set the total years and the first part of the sum to set the |
I'm in charge of triaging at present - we'll start going through PR's tomorrow night - it's going to take time to clear the whole backlog first, angular 1.3 compatibility is the next goal. |
Yeah I've seen that backlog indeed. It's freakin' huge. I suppose 9 out of 10 PR's are out of date by now unfortunately. I don't know if you already have some sort of way of doing things but if you for example could comment on each PR that you want tested and add specific test cases that you want to be checked, I and other interested community members could help out testing those PR's. |
BREAKING CHANGE: yearRange is replaced by yearRows and yearColumns fixes angular-ui#3348
BREAKING CHANGE: yearRange is replaced by yearRows and yearColumns fixes angular-ui#3348
This is a feature request / proposal (I'll create a PR if you guys can enlighten me on some points).
Right now we have the
yearRange
property in thedatepicker-options
attribute / default options object.By tweaking that value, the maximum number of years shown in the 'yearpicker' is adjusted.
By default, the
yearRange
is set to 20 and a max number of years per row is hardcoded to 5.This creates a nice 5x4 grid of years in the yearpicker view.
When ajusting the
yearRange
setting, the max number of years is still hardcoded to 5. For example in my use case I wanted a smaller yearpicker and set the value to9
. The result was as follows:To change this, I want to be able to adjust the maximum number of years per row to
3
to create a nice and neat 3x3 grid like this (dont mind the styling):Now my proposition was to implement a new config key:
yearsPerRow
Using that key you can, as one might expect, adjust the number of years per row to your needs.
Another solution would be to deprecate
yearRange
and introduce something similar toyearGrid
and accept a string value likeyear range X years per row
. In the example situation above I would have this in my datepicker-options config object:But then again describing a grid like that can be confusing (one could expect a result of 9 years in a row, 3 rows high).
So what do you think? Go for
yearsPerRow
seems like the fastest and clearest solution.The text was updated successfully, but these errors were encountered: