Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1011481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:14:27+00:00 2026-05-16T09:14:27+00:00

I’ve gone through the options for this plugin several times and can’t seem to

  • 0

I’ve gone through the options for this plugin several times and can’t seem to find a way of turning off this behaviour: the current or selected date is highlighted in all months of the widget, not only the current month. For example if I select August 17th then advance to september, october and so on, the 17th will also be selected in those months, which in my mind makes no sense. I can’t figure out why it’s doing that, or even the rationale behind it if it’s a feature (I guess that can be a secondary question). Any idea how to turn it off? The link on all the months are being assigned the same css classes. Below are the options I’m using:

var dates = $("#checkin").datepicker({
    changeMonth: true,
    numberOfMonths: 2,
    dateFormat: 'M d, yy'
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T09:14:28+00:00Added an answer on May 16, 2026 at 9:14 am

    The bug (or feature, but i hope it’s not) was introduced in the 1.8.4 release of jQuery UI (hence the demo posted by D Hoerster works, since it’s using the 1.8.2 version). The source of it is on line 8384 in this version hosted by Google. It’s the part covering the generation of the actual HTML of the datepicker. It’s inside a loop, iterating over each month to be drawn. It reads

    var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
    

    Now, drawmonth/year is the current month being drawn (duh), so it’s pretty obvious what’s going in. The result is your stated problem – if you select the 17th in one month, selectedDate will be set to the 17th of every month as you iterate over them and these will be highlighted. Judging by the variable name (selectedDate) and it’s semantic meaning it should instead state

    var selectedDate = this._daylightSavingAdjust(new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay));
    

    The funny thing is that this error was also present in the 1.8.2 version, but the code that does the highlighting didn’t use it in the previous version. In 1.8.2, highlighting the current date was done like (on line 8446):

    (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
    

    and looking at the code, it’s clear that it should instead be as it is in the 1.8.4 version (use selectedDate instead of currentDate):

    (printDate.getTime() == selectedDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
    

    So it’s weird there’s not any more bugs going on, since selectedDate apparently is wrong and is used several places. (And the fact that nothing was wrong in the previous version, despite the wrong variable being used to highlight the current date) I’ve been looking at this code for too long now, so I don’t know whether I’m right or totally wrong anymore. This should nevertheless be a good fundament for people wanting to investigate it further and possibly do a bug report. I’ll do it myself eventually when i get the time (and my sanity back)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.