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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:40:06+00:00 2026-05-16T21:40:06+00:00

I created a calendar with Datepicker, but recently I’m having some trouble with it.

  • 0

I created a calendar with Datepicker, but recently I’m having some trouble with it. The default date is always selected during months. I.e. today is Sep 15th, when I navigate to other months, the 15th day of that month is select as well (as if it’s the defaultDate).

As they say, “A picture is worth a thousand words”:

http://img405.imageshack.us/img405/6348/calendarmo.png

Translation:
Outubro -> October, Novembro -> November, …
Dom -> Sunday, Seg -> Monday, …

That’s my code for this datePicker:

$("#datepicker").datepicker({
    //Espaço de tempo para reserva de horário
    minDate:'0',
    maxDate: '31/12/2010',
    defaultDate: null,
    //Controle de acesso
    beforeShowDay: verificaData,
    onSelect: retornaTexto
});

This is an auxiliary function that I use:

function verificaData(date) {
   if (date.getDay() != 0) {
    for (var i = 0; i < datasDisponiveis.length; i++) {
     if (date.toString() == new Date(datasDisponiveis[i]).toString()) {
      return [true,''];
     }
    }
    return [false,''];
   }
   return [false,''];
  }

Basicaly it verify an array checking if the date is currently available.

That’s about it. I can’t see where the error is, can you guys help me?

Thanks in advance!

EDIT:

I think I’m using the latest Datepicker version, this are my includes:

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.ui.datepicker-pt-BR.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  • 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-16T21:40:07+00:00Added an answer on May 16, 2026 at 9:40 pm

    This is what I use for my datepicker (jQuery UI Datepicker 1.7.2) :

    untillcal.datepicker({
        inline: true,
        minDate: minUntillDate,
        maxDate: maxUntillDate, 
        numberOfMonths: 1, 
        dateFormat: 'dd/mm/yy',
        hideIfNoPrevNext: true,
        showOn: 'button',
        constrainInput : true,
        beforeShowDay: function(date) {
            if($.isArray(excludedDays)){
                if($.inArray(Date.parse(date), excludedDays) > -1)
                    return [false,''];
            }
            return [true,''];
        },
        buttonImage : '../../images/calendar.gif'
    });
    

    But this will just select the date specified and won’t select the same day on the next month.

    Just wanted to share, I know it doesn’t solve your problem.

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

Sidebar

Related Questions

I created a custom calendar for my calendar app ... but I have some
Here's our scenario: We've created a sharepoint 2007 calendar on our intranet site We
we are trying to create a calendar function in python. we have created a
I am building an Day View calendar app. I have already created the empty
Obviously I could create a Calendar object with the date and use get(DAY) on
I feel like this is a silly question but I always find that modifying
I have a calendar created with a table. Users can mark the dates on
I've searched for a free and good Date picker out there but I didn't
I have an inline jquery ui datepicker that has some days disabled, like this
Ok I'm using the jQuery Mobile Framework and adding the Experimental Date Picker but

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.