Mohammed Rafi Khan

Mohammed Rafi Khan

  • NA
  • 349
  • 33.3k

how to set minimum date in datetimepicker using jquery...?

Jun 14 2016 8:52 AM
the code i have tired is 
 
 @Html.EditorFor(model => model.taxDefination.EffectiveDate, "", new { htmlAttributes = new { @class = "form-control datePickerOnly", @id = "txteffectivefrom", @required = "required", @style = "z-index:99999;", @Value = Model.taxDefination.EffectiveDate.ToString("dd/MM/yyyy") } })
 
var today = new Date();
var dd = today.getDate() - 7;
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
if (dd < 10)
{
dd = '0' + dd
}
if (mm < 10)
{
mm = '0' + mm
}
var today = dd + '-' + mm + '-' + yyyy;
$("#txteffectivefrom").datePickerOnly("option", "minDate", today);
 
 
 
it is not working 
 
 
 
 
 

Answers (1)