Need to display only 5days from specific date in datepicker

Mar 11 2018 8:20 AM
Hi,
 
I have used a jquery datepicker in my code for user input.But i have a requirement where i have to display only 5 days from a specific date in my jquery datepicker excluding weekends.Could you please assist as i am new to jquery?
 
Regards,
Miruthula
 
I have fetched the 5 days from dat_eta in to an array in a hidden variable.Now i need to know how to enable only these days in the datepicker.
 
Please find the code below.
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="JAVASCRIPT_CALENDAR_TESTING.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="../Content/themes/jquery-ui.css" rel="stylesheet" />
<script src="../Scripts/jquery-1.8.2.js"></script>
<script src="../Scripts/jquery-ui-1.8.24.js"></script>
<script>
$( function() {
$("#datepicker").datepicker();
} );
</script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>Request date:</td>
<td><input type="text" id="datepicker"/></td>
<% int scm_date;
scm_date = (9 / 24 + 1);
DateTime dat_eta = DateTime.Now;
string result;
dat_eta = dat_eta.AddDays(scm_date);
result = dat_eta.ToString("MM:dd:yyyy");
string[] array=new string[6];
for (int i=0;i<=5;i++)
{
if (i==0)
{
}
else
{
dat_eta = dat_eta.AddDays(1);
}
result = dat_eta.ToString("MM:dd:yyyy");
array[i]=result;
}
hiddenvalue.Value = string.Join(",", array);
%>
<td><input type="hidden" id="hiddenvalue" name="hiddenvalue" runat="server" /></td>
</tr>
</table>
<script type="text/javascript">
</script>
</div>
</form>
</body>
</html>

Answers (5)