Solved

How do I block out days in Jquery calendar

Posted on 2010-08-19
4
407 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
[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
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 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