How we can set minDate and maxDate of Bootstrap datetimepicker in MVC 4 on selection of DropDownListFor item
<p>I want to set MinDate or MaxDate of Bootstrap datetimepicker on selection of DropDownListFor in MVC. This is reason for this is in India some pay scale released on a year. if A pay scale releasing year is 2005. then no one show that I am getting this pay scale from 2002.</p>

<p>This is my jQuery code: </p>

<pre><code>$('#datepickerFrom1').datetimepicker({
        viewMode: 'years',
        format: 'DD/MM/YYYY'
    });

    $('#datepickerTo1').datetimepicker({
        viewMode: 'years',
        format: 'DD/MM/YYYY',
        useCurrent: false
    });

    $("#datepickerFrom1").on("dp.change", function (e) {
        $('#datepickerTo1').data("DateTimePicker").minDate(e.date);
    });
    $("#datepickerTo1").on("dp.change", function (e) {
        $('#datepickerFrom1').data("DateTimePicker").maxDate(e.date);
    });
</code></pre>

<p>This is jQuery for selection on dropdownlistfor item:</p>

<pre><code>$(document).ready(function () {
    //Dropdownlist Selectedchange event
    $("#ddlPayScaleCode").change(function () {
        $.ajax({
            type: 'POST',
            url: '@Url.Action("GetMaxMinDate")',
            dataType: 'json',
            data: { id: $("#ddlPayScaleCode").val() },
            success: function (citys) {
                // states contains the JSON formatted list
                // of states passed from the controller
                $.each(citys, function (i, city) {
                    //$("#ddlPSU").append('&lt;option value="' + city.Value + '"&gt;' + city.Text + '&lt;/option&gt;');
                    if (i == 0) {
                       $('#datepickerFrom1').datetimepicker({
                                                    minDate: '01 Jan 2015'
                       }).datetimepicker("update");;

                        alert(city.Value + i.toString());

                    }

                });
            },
            error: function (ex) {
                alert('Failed to retrieve states.' + ex);
            }
        });
        return false;
    })
});
</code></pre>

<p>This is design code:</p>

<pre><code>                 &lt;div class="row" style="margin: 0px 10px 0px 10px;padding: 0px 10px 0px 10px;"&gt;
                 &lt;div class="row" style="background-color:#8f4094;color:White;"&gt;
                &amp;nbsp;&amp;nbsp;&lt;span style="font-weight:bold;font-size:16px;"&gt;Add Experience(s):&lt;/span&gt;
            &lt;/div&gt;
            &lt;br /&gt;
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                    @Html.LabelFor(model =&gt; model.DesignationAndPlaceOfPosting)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                     @Html.TextBoxFor(model =&gt; model.DesignationAndPlaceOfPosting, new { @class = "form-control" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.DesignationAndPlaceOfPosting)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                    @Html.LabelFor(model =&gt; model.NameOfOrganization)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                   @Html.TextBoxFor(model =&gt; model.NameOfOrganization, new { @class = "form-control" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                     &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.NameOfOrganization)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                  @Html.LabelFor(model =&gt; model.PayScaleCode)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                    @Html.DropDownListFor(model =&gt; model.PayScaleCode, ViewBag.PayScaleCode1 as IEnumerable&lt;SelectListItem&gt;, "select", new { id = "ddlPayScaleCode", @class = "form-control" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.PayScaleCode)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;  
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                  &lt;b&gt; Period &lt;/b&gt; @Html.LabelFor(model =&gt; model.PeriodFrom1)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                     @Html.TextBoxFor(model =&gt; model.PeriodFrom1, "{0:dd/MM/yyyy}", new { @class = "form-control datepickerFrom1", id = "datepickerFrom1", placeholder = "DD/MM/YYYY" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.PeriodFrom1)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                  &lt;b&gt; Period &lt;/b&gt;   @Html.LabelFor(model =&gt; model.PeriodTo)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                    @Html.TextBoxFor(model =&gt; model.PeriodTo1, "{0:dd/MM/yyyy}", new { @class = "form-control datepickerTo1", id = "datepickerTo1", placeholder = "DD/MM/YYYY" })
                    &lt;input type="text" id="txtMindate" value="01 January 2016" /&gt;
                    &lt;input type="text" id="txtMaxDate" value="01 December 2016" /&gt;
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.PeriodTo1)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;                         
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                 &lt;b&gt;Reporting to Designation&lt;/b&gt;
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                     @Html.TextBoxFor(model =&gt; model.ReportingToDesignation, new { @class = "form-control" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.ReportingToDesignation)&lt;/span&gt;
                &lt;/div&gt;
            &lt;/div&gt;  
                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                &lt;b&gt; Self Declaration &lt;/b&gt;&lt;br /&gt;Whether meets the mandatory requirement
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                    @Html.DropDownListFor(model =&gt; model.SelfDeclarationExpCode, ViewBag.VwSelfDeclarationExp as IEnumerable&lt;SelectListItem&gt;, "select", new { id = "ddlSelfDeclarationExpCode", @class = "form-control" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.SelfDeclarationExpCode)&lt;/span&gt;
                &lt;/div&gt;
               &lt;/div&gt;

               &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;
                &lt;b&gt; If yes, nature of duties in support of the declaration&lt;/b&gt;&lt;br /&gt; (in not more than 250 characters)
                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                     @Html.TextAreaFor(model =&gt; model.RelevantExperienceDetails, new { id = "txtbxRelevantExperienceDetails", @class = "form-control", style = "height:65px;" })
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;
                    &lt;span style="color: Red"&gt;@Html.ValidationMessageFor(model =&gt; model.RelevantExperienceDetails)&lt;/span&gt;
                &lt;/div&gt;
               &lt;/div&gt;

                     &lt;div class="row" style="margin: 0px 0px 5px 0px;"&gt;
                &lt;div class="editor-label col-lg-4" style="text-align: right;"&gt;

                &lt;/div&gt;
                &lt;div class="editor-field col-lg-4" style="text-align: left;"&gt;
                     @* &lt;input type='button' id='button111' class='removebtn' /&gt;*@
                        @*&lt;input type="button" id="txt" value="Add More" style="width: 150px; font-family:Verdana"
                               class="btn btn-md btn-success fa fa-lg" /&gt;*@
                        &lt;input type="submit" id="btnExperience" value="Save Experience" style="width: 150px; font-family:Verdana"
                               class="btn btn-md btn-success fa fa-lg" /&gt;
                &lt;/div&gt;
                &lt;div class="col-lg-4" style="text-align: left; color: Red;"&gt;

                &lt;/div&gt;
                &lt;/div&gt;            
                &lt;/div&gt;
</code></pre>