?
Solved

JQuery help with datepicker - minDate

Posted on 2012-12-20
4
Medium Priority
?
1,060 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 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