What's your biggest current challenge? Have your say in Community Polls along the right column.

Why did my jQuery calendar stop working suddenly?

Solved

Why did my jQuery calendar stop working suddenly?

StemsWilder
Visitor
2 0 1

Hello,

Is someone able to help me determine why my Jquery calendar is no longer appearing when clicking in the text box?

I think it stopped working at some point yesterday and as far as I know I've not altered any of the Calendar code.

I have been working on the theme code so it is possible I've changed something there by mistake

The address is:

https://www.stemswilder.com/cart

Calendar code:

 

 

  {{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
  <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" defer="defer"></script>

  <div style="clear:both;">
    <p>

      <span class="h7">Pick a delivery/collection date </span> <span style="font-size:0.8em">(Required)</span> </br>
      <span style="font-size:0.8em">Nationwide deliveries are typically delivered within 5 working days.</span> 
      <input id="date"required class="required" style="text-align:right;" readonly  type="text" name="attributes[Delivery/Collection Date]" value="{{ cart.attributes.date }}" />
    </p>
  </div>

  <script>
    window.onload = function() {
    if (window.jQuery) {
    let $ = window.jQuery;
        
    var dates = ["16/08/2021","17/08/2021","18/08/2021","19/08/2021","20/08/2021","21/08/2021","22/08/2021","23/08/2021"]; /*================ Blocked Dates ================*/
 
	function DisableDates(date) {
    var string = jQuery.datepicker.formatDate('dd/mm/yy', date);
    return [dates.indexOf(string) == -1];
}


        $(function() {
          $("#date").datepicker({
            minDate: +1, 
            maxDate: '+6M',
            dateFormat: 'DD d MM yy',	
            beforeShowDay: DisableDates,
          });
        });
      }
    }
    

  </script>

 

 

 

 

 

Please let me know if you need any more info.

Thanks

Accepted Solution (1)
Ecommpremium
Shopify Partner
512 43 93

This is an accepted solution.

yes please come in DM for zoom meeting so we can take a look deeper into this! @StemsWilder 

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website

View solution in original post

Replies 3 (3)

Ecommpremium
Shopify Partner
512 43 93

some time you have to update the jquery CDn version it works.

try connecting downgrade or upgrade CDN version it will work!

@StemsWilder 

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website
StemsWilder
Visitor
2 0 1

Thanks for the response. I've updated the versions in theme.liquid, delivery-date.liquid and cart-template.liquid (i think correctly) and still no joy.

Can you tell if if I've updated them correctly?

Ecommpremium
Shopify Partner
512 43 93

This is an accepted solution.

yes please come in DM for zoom meeting so we can take a look deeper into this! @StemsWilder 

- Did we solve your issue? Like & Mark As Solution to help the community
- SKYPE: ahsanaliawan
- 300+ Video Tutorials
-Website