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

Date picker year range changes #287

Open
clubbavi opened this issue Mar 30, 2016 · 8 comments
Open

Date picker year range changes #287

clubbavi opened this issue Mar 30, 2016 · 8 comments

Comments

@clubbavi
Copy link

Hello,

I am currenty using wicegrid Jquery datepicker. We upgraded from wicegrid 3.0.4 to 3.6. So previously, there was no datepicker year range in the config file. So, we can select the year range as in:
https://jqueryui.com/datepicker/#dropdown-month-year .

But now in 3.6, we are defining a year range as:
Wice::Defaults::DATEPICKER_YEAR_RANGE = (from = Date.current.year - 10).to_s + ':' + (from + 15).to_s
So it is only within a range and all years are shown as scrollable.
Is there any extra configuration in that to work like the jquery year range ?

Thanks.

@leikind
Copy link
Owner

leikind commented Mar 30, 2016

no

@clubbavi
Copy link
Author

Can we add that feature from the previous wicegrid version in our configuration file or it was by default coming previously and not now?

@leikind
Copy link
Owner

leikind commented Mar 30, 2016

I think I misunderstand you.
Could you please specify clearly
(1) What did you have in 3.0.4
(2) What changed?
(3) What disappeared?
(4) What do you want to have

@clubbavi
Copy link
Author

As the jquery Datepicker in the above link: For year selection, if we select some date then automatically 10 more years is added to the year list. Same if we go in the past year as well.
Currently in version 3.6 we have to add 'DATEPICKER_YEAR_RANGE' in the configuration file, so it becomes limited & all dates are visible at the same time with scrollable.

Even I added extra code to make it work:
$( "#grid_f_dob_fr_date_placeholder" ).datepicker({ changeMonth: true, changeYear: true });
In this case, the picker is always visible & it behaviour is changed.
In the previous version we did not do anything, bydefault it was working the jquery way.

@leikind
Copy link
Owner

leikind commented Mar 30, 2016

Have you tried removing DATEPICKER_YEAR_RANGE ?

@clubbavi
Copy link
Author

Yes, I am getting this error:

WiceGrid: Could not find constant DATEPICKER_YEAR_RANGE in the configuration file! It is possible that the version of WiceGrid you are using is newer than the installed configuration file in config/initializers. Constant Wice::Defaults::DATEPICKER_YEAR_RANGE is missing and you need to add it manually to wice_grid_config.rb or run the generator task=: rails g wice_grid:install

So DATEPICKER_YEAR_RANGE, we have to mention in the config file as of version 3.6.

@leikind
Copy link
Owner

leikind commented Mar 30, 2016

hm.. not good.

can you try smth like $( ".hasDatepicker" ).datepicker( "option", "yearRange", "2000:2042" );

@clubbavi
Copy link
Author

Sorry, for the late reply. Its the same defiining DATEPICKER_YEAR_RANGE in the config file. Just that whatever range we have mentioned in the configfile, we can ovverride it by this.
I will check if I am doing anything wrong.

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