Solved

How do I block out days in Jquery calendar

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
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.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

830 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