Solved

JQuery help with datepicker - minDate

Posted on 2012-12-20
4
1,026 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 500 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Awk : two files math 8 28
PowerShell and cisco ios 3 44
what should i learn? javascript or typescript? 3 36
Hta File displays dynamic File names 4 47
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

749 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