Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery DatePicker change highlighted color onSelect of a particular date
    primarykey
    data
    text
    <p>I have this code of Jquery datepicker that I am working on. What I want to do is change the color of the current highlighted date to grey when I click on anyother date, and the color of the clicked date to green. </p> <p>The tricky part is that only the ones which are grey can turn green and viceversa but no other dates can turn into green on click.</p> <p>I dont understand what I am doing wrong. Or is it that my code is completely wrong. If anyone can help. </p> <p>here's the code</p> <pre><code>$(function() { var togo=['10/25/2013'] var datesArray=['10/27/2013','10/28/2013'] var datesArray1=['10/25/2013','10/26/2013'] var datesArray2=['10/24/2013'] $( "#datepicker" ).datepicker({ numberOfMonths: 2, selectMultiple:true, beforeShowDay: function (date) { var theday = (date.getMonth()+1) +'/'+ date.getDate()+ '/' + date.getFullYear(); return [true,$.inArray(theday, datesArray2) &gt;=0?"specialDate":($.inArray(theday, datesArray)&gt;=0?"specialDate2":($.inArray(theday, datesArray1)&gt;=0?"specialDate1":''))]; }, onSelect: function(date){ console.log("clicked"+date); return [true,$.inArray(date, togo) &gt;=0?"specialDate":($.inArray(date, datesArray1)&gt;=0?"specialDate1":'')] ; } }); //$.inArray(theday, datesArray) &gt;=0?"specialDate":'specialDate1' }); </code></pre> <p>For a clearer picture of what I am doing and what I want heres a JSFiddle</p> <p><a href="http://jsfiddle.net/pratik24/Kyt2w/3/" rel="nofollow">http://jsfiddle.net/pratik24/Kyt2w/3/</a></p> <p>thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload