Skip to content
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

Option yearRange is needed for datepicker #61

Closed
dima4p opened this issue Nov 28, 2011 · 6 comments
Closed

Option yearRange is needed for datepicker #61

dima4p opened this issue Nov 28, 2011 · 6 comments
Assignees

Comments

@dima4p
Copy link
Collaborator

dima4p commented Nov 28, 2011

And most probably for the portotype version.
You see, it is strange to have the range 2001..2021 for the birthday year of the user.

@leikind
Copy link
Owner

leikind commented Nov 28, 2011

any ideas about the API and the way it should look like?

@dima4p
Copy link
Collaborator Author

dima4p commented Nov 28, 2011

I think, the option for #column should be created. I suggest to make it indifferent on the java-script used, will it be datepicker, calendarview, or something else. It should take the hash that is to be translated to JS object and passed to the JS call.
It may be named :js_options, so in my case it will be like the following for the ruby 1.8:
g.column :attribute_name => 'born_on',
:js_options => {:changeMonth => true, :changeYear => true, :yearRange => '-120:+0', :defaultDate => '-30y'}

@dima4p
Copy link
Collaborator Author

dima4p commented Nov 28, 2011

P.S. I know you pass changeMonth and changeYear, but maybe someone will want it to be false.

@ghost ghost assigned leikind May 8, 2013
@leikind
Copy link
Owner

leikind commented May 8, 2013

The solution is very basic: a88a750

There is a default year range for all datepickers in the config file. Providing WiceGrid configuration API to set up each grid seems redundant when one can easily change the range with javascript:

$( ".hasDatepicker" ).datepicker( "option", "yearRange", "2000:2042" );

@leikind leikind closed this as completed May 8, 2013
@dima4p
Copy link
Collaborator Author

dima4p commented May 8, 2013

What if different ranges are needed, say for :date_of_birth and :passport_valid_tilll?

@leikind
Copy link
Owner

leikind commented May 8, 2013

Then you use the aforementioned javascript with DOM IDs to target specific datepickers . There is no need for additional API when using datepicker( "option", param, value ) is a perfectly valid jQuery way.

kreintjes pushed a commit to kreintjes/wice_grid that referenced this issue Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants