Solved

How do I block out days in Jquery calendar

Posted on 2010-08-19
4
397 Views
Last Modified: 2012-06-22
I am using the code attached to include a jquery calendar in my clients app.  The client wants to block out the next two weeks (10 days)so users can't try to place rush jobs.  Can I do this without pulling the jquery code into the web space?  If so, who do I do it?
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>

<!--<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/excite-bike/jquery-ui.css" type="text/css" rel="Stylesheet" />-->

<link href="css/excite-bike/jquery-ui.css" type="text/css" rel="Stylesheet" />





<script type="text/javascript">

//google.load('jquery', '1.3.2');

//google.load("jqueryui", "1.7.2");



	$(function() {

		$("#Q_106").datepicker();

        $("#Q_63").datepicker();

		$("#Q_158").datepicker();

	});

	

	</script>

Open in new window

0
Comment
Question by:justmelat
  • 3
4 Comments
 
LVL 16

Accepted Solution

by:
JF0 earned 500 total points
ID: 33475617
    From the documentation:
Set a minimum selectable date via a Date object or as a string in the current dateFormat,  or a number of days from today (e.g. +7) or a string of values and  periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days,  e.g. '-1y -1m'), or null for no limit.          

Initialize a datepicker with the minDate option specified.  $( ".selector" ).datepicker({ minDate: new Date(2007, 1 - 1, 1) });

So in your case:
$("#Q_106").datepicker({ minDate: new Date(+14) });

0
 
LVL 1

Author Comment

by:justmelat
ID: 33475883
Hi JF0

I tried this:

So in your case:
$("#Q_106").datepicker({ minDate: new Date(+14) });

But I am still able to pick any dates, even the next day
0
 
LVL 1

Author Comment

by:justmelat
ID: 33475940
got it JF0

this work:  $("#Q_106").datepicker({ minDate: '5'});

Thanks so much for your help.  I would not have figured it out without your info.
0
 
LVL 1

Author Closing Comment

by:justmelat
ID: 33475953
na
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now