Solved

How do I block out days in Jquery calendar

Posted on 2010-08-19
4
399 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

770 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