Skip Navigation

[Resolved] How to extend range of Datepicker in filters?

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Michelle Dodd 6 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1120991

I found this topic:
https://toolset.com/forums/topic/year-range-in-types-jquery-ui-datepicker/

But the solution is not in the response you wrote or has been hidden. I need the range to go back to the year 2000 but it only goes back 10 years. How do I extend this? Could you please make your answers clear so others can use the solution?

The specific page is hidden link

Thanks!
Michelle

#1121528

Hi Michelle,

Thank you for contacting us and I'll be happy to assist.

You can adjust the year range for the Datepicker, using it's built-in parameter "yearRange".
( ref: hidden link )

For example, to set the year selection to start from "2000" to the "current year", you can add the following code in "JS editor" tab ( under the "Search and Pagination" section in View editor):


$(document).ready(function () {
   $.datepicker.setDefaults({
  	yearRange: "2000:c+0"
	});
});

I hope this helps! Please let us know how it goes and if you need any further assistance.

regards,
Waqar

#1121686

Thank you! This is exactly what I needed.

#1142511

Hi there,

It looks like this isn't working now. Maybe I was in such a hurry with everything else I was doing at the time I didn't test thoroughly, but I thought it was working. Here's the page on our dev server:

hidden link (password: Wild!)

If you search for press releases in a date range prior to 2008 there are no results, even though we have many of them.

I can give you the admin login if that would help. I put the code you gave me in the JS tab of the editor.

Thanks,
Michelle