//////HTML
<asp:TextBox class="form-control" runat="server" AutoComplete="off" ClientIDMode="Static"
placeholder="dd/mm/yyyy" ID="Startdate");"
/>
//////Jquery
1.
$(document).ready(function
() {
setdatesRanges();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(setdatesRanges);
});
2.
function setdatesRanges() {
Date_Range('Startdate', 'EndDate', true);
}
3.
function Date_Range(tFrID, tToID, IsStartDate) {
var setMinDate = "";
if (IsStartDate == true)
{
setMinDate = 'now';
}
$('#' + tFrID + ',#'
+ tToID + '').datepicker({
format: "dd/mm/yyyy",
useCurrent: false,
autoclose: true,
startDate: setMinDate
});
$("#Startdate").datepicker().on('changeDate', function
(e) {
var minDate = new
Date(e.date);
$('#' + tToID).datepicker('setStartDate',
minDate);
$('#' + tToID).val($(this).val());
});
}
No comments:
Post a Comment