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 947035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:01:02+00:00 2026-05-15T23:01:02+00:00

Hey Guys, i have a big problem with my jQuery Datepicker Script. I use

  • 0

Hey Guys,

i have a big problem with my jQuery Datepicker Script.
I use jQuery 1.4.2 and jQuery Ui 1.8.

Background:
I have a reservation calendar with a fromDate and toDate and all Dates which are already reserved are disabled. The Dates come from Database by AJAX Call.

Problem:
Everything works fine in Firefox – but IE 7/8 does not disable Dates execept for the actual month. I do not get any Error Message in IE 7/8!

Here’s my code:

First the AJAX Call to get the Dates:

    var navDays = (function () {
        var val = null;
        $.ajax({
            'async': false,
            'global': false,
            'url': WEG_URL+'rsv_avdates.php',
            'success': function (data) {
                val = data;                    
            }
        });
        return val;
    })();

    var disDays = navDays.split('|');  

In disDays i have now Dates like ‘2010-01-01′,’2010-01-02’,…..

Here’s my disableDates function:

    function disabledDays(date) {
        var m = date.getMonth();
        var d = date.getDate();
        var y = date.getFullYear();

        for (var i = 0; i <= disDays.length-1; i++) {
          var myDate = new Date(disDays[i]);              
          if ((m == (myDate.getMonth())) && (d == (myDate.getDate())) && (y == (myDate.getFullYear())))
          {
            return [false];
          }
        }
        return [true];
    }   

and finally my datepicker call:

    $('#fromdate, #todate').datepicker(
    {
        showOn: "both",
        buttonImage: 'images/calender.gif',
        buttonImageOnly: true,
        beforeShowDay: disabledDays,
        dateFormat: "dd.mm.y",
        firstDay: 1, 
        changeFirstDay: false
    }); 

Do you have any idea why all works fine in Firefox, Safari, Chrome, … but NOT in IE 7/8 ???

Thanks for all.

Sascha

  • 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-15T23:01:03+00:00Added an answer on May 15, 2026 at 11:01 pm

    The problem is that those date strings are not really right for just instantiating a date object. Here’s how you could make “disDays” be an array of dates, which would let you just use those directly in the callback function without having to construct new Date instances all the time:

      var disDays = $.map(navDays.split('|'), function(d) {
        var dd = d.split('-');
        return new Date(parseInt(dd[0], 10), parseInt(dd[1], 10) - 1, parseInt(dd[2], 10));
      });
    

    Now the callback code can just do this:

         function disabledDays(date) {
          var m = date.getMonth();
          var d = date.getDate();
          var y = date.getFullYear();
    
          for (var i = 0; i <= disDays.length-1; i++) {
            var myDate = disDays[i];             
            if ((m == (myDate.getMonth())) && (d == (myDate.getDate())) && (y == (myDate.getFullYear())))
            {
              return [false];
            }
          }
          return [true];
        }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I have one more question lol. I am using a script that
hey guys having this really simple problem but cant seem to figure out have
Hey guys I have an ajax jquery function that receives data from a php
Hey guys I have done lots of work with ASIHTTPRequest so far and use
Python: How to remove all duplicate items from a list Hey guys I have
Hey guys here is the problem i am facing i have a User class
Hey guys, I have a problem with a code that I've been writing. I
Hey guys I have a table with a couple of checkboxes, all of those
Hey guys I have a problem, I have a NSDictionary of NSArrays and im
Hey guys i have a problem. I have a listview that is dynamically filled.

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.