Skip Navigation

[Resolved] Jquery Datepicker not working after updating to views 2.8.2

This support ticket is created 5 years, 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 5 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1316281

CORRECTION title should say updating to views 2.9.1

https://toolset.com/forums/topic/post-date-and-close-date-limit-range-to-28-days/

Hi,

Above is the previous ticket which was resolved perfectly - however, since upgrading to Views 2.9.1 the code below is no longer working.

jQuery(window).bind("cred_form_ready", function() {
   
    var ts_date_handler = function( dateIsEmpty, datepickerObj ){
 
        var selected = datepickerObj.selectedYear + "/" + (datepickerObj.selectedMonth + 1) + "/" + datepickerObj.selectedDay;
 
        var selectedDate = new Date( selected );
 
        var limitDate = new Date();
 
        limitDate.setDate(selectedDate.getDate() + 28);
 
        $('input[name="wpcf-job-closing-date[display-only]"]').datepicker('option', {minDate: selectedDate, maxDate: limitDate });
 
    }
 
    $('input[name="wpcf-job-post-date[display-only]"]').datepicker('option', {minDate: 0,maxDate: 28, onClose: ts_date_handler } );
   
});

The page where this code is in action is on hidden link (you will need to be logged in to see it properly - I have supplied site access details)

#1316309

Hi Nigel - I swapped $ for jQuery and this has fixed the issue.

My issue is resolved now. Thank you!

#1316319

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Adam

Do you have a staging site suitable for some routine testing?

I noticed in the browser console a JS error originating from the autoptimize plugin, but if I disable that there are 500 errors for ajax requests also visible in the browser.

I'd like to do some testing switching versions of Views and disabling caching plugins and similar, but didn't want to do that on your live site...

#1316323

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, I missed your update while hopping across to a meeting, glad that it is resolved.