?
Solved

JQuery help with datepicker - minDate

Posted on 2012-12-20
4
Medium Priority
?
1,113 Views
Last Modified: 2013-01-12
How can I modify this script to "block" current date in my calendar datepicker popup?  I don't want users to pick the current date for my appointment application, ie., no same-day appointments allowed.  I'm modifying existing code and do not know javascript well.

$(document).ready(function() {
    $(#div_date").hide();
});

$(function () {
    $(#apptDate").datepicker({ beforeShowDay: $.datepicker.noWeekends}
  );
     $("#date_pickup_icon").click(function () {
        $("#apptDate").datepicker("show");
     });
});

_____________________
I use the jquery library.  There is an attribute (excuse the incorrect terminology); "minDate".  Default is NULL.  How do I use this to specify the blocking of the current date and previous dates.
0
Comment
Question by:newBieProgram
  • 2
4 Comments
 
LVL 3

Expert Comment

by:KevinSchmaltz
ID: 38711213
I think you want to set the mindate equal to 1 check out the link below:

http://stackoverflow.com/questions/3247656/jquery-ui-datepicker-disable-todays-date-if-today-is-monday
0
 
LVL 4

Accepted Solution

by:
brendonfeeley earned 2000 total points
ID: 38713071
minDate needs to be set to +1d

Try this:

$(document).ready(function() {
      $(#div_date").hide();
});

$(function () {
      $(#apptDate").datepicker({
            minDate: '+1d',
            beforeShowDay: $.datepicker.noWeekends
      }
  );
       $("#date_pickup_icon").click(function () {
            $("#apptDate").datepicker("show");
       });
});
0
 

Author Comment

by:newBieProgram
ID: 38714917
I will try this. Thank you.
0
 

Author Comment

by:newBieProgram
ID: 38771027
Yes, it worked.  I set the minDate to +1.  Thank you!  Very much appreciated!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question