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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:01:39+00:00 2026-05-20T05:01:39+00:00

this page offered sample code that would be ideal for a task I’m working

  • 0

this page offered sample code that would be ideal for a task I’m working on

Datepicker for web page that can allow only specific dates to be clicked

however, when I implement it, I get the following error:
TypeError: Result of expression ‘date.getMonths’ [undefined] is not a function.

I’m testing using the same versions of jquery (1.4.4) and jquery ui on jquery ui’s official site
any help is greatly appreciated!

<!DOCTYPE html>
<html>
<head>
<base href="http://jqueryui.com/demos/datepicker/">
<title>TEST</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.4.4.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">

<script>
$(function() {

dates_allowed = {'2/26/2011': 1,'4/2/2011': 1};
$.datepicker.setDefaults({minDate: "+0"});      
$.datepicker.setDefaults({maxDate: (new Date(2011, 3, 2))});

    $('#Date').datepicker({

    // called for every date before it is displayed
    beforeShowDay: function(date) {

        var date_str = [
            date.getFullYear(),
            date.getMonths() + 1,
            date.getDay()
        ].join('-');

        if (dates_allowed[date_str]) {
            return [true, 'good_date', 'This date is selectable'];
        } else {
            return [false, 'bad_date', 'This date is NOT selectable'];
        }
    }
});
});
</script>
</head>
<body>
<input type="text" id="Date">
</body>
</html>
  • 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-20T05:01:39+00:00Added an answer on May 20, 2026 at 5:01 am

    That would be because it’s .getMonth, singular.

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

Sidebar

Related Questions

According to this page you can implicitly convert shared_ptr<Foo> to shared_ptr<const Foo> . That
This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle. How would
On this page in the Subversion manual , it says that When you commit
I have an ASPX page and on this page I have a control that
This page says you need to call PrintSetupDlg , but this code PAGESETUPDLG printDialog;
See this page i'm currently working on. http://lacrosselaundry.com/lacrosseLaundry/contact.php If i change the font-size for
This page I have been developing for my app has been working fine locally
This page works well even in IE6, but in Chrome it's not working. I
This page from Adobe says to add a wmode parameter and set its value
This page displays beautifully in firefox but i get all kinds of problems when

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.