locked
Calendar is not populating in IE11-ASP.NET MVC RRS feed

  • Question

  • Hi,

    I am doing some validation for the below date picker,it is working fine in chrome.

    But this is not working in the browser IE11.

    Please let me know if I am missing anything here as this is a production issue.

    //Index.cshtml

    <td>
                                            @Html.LabelFor(model => model.contractenddate, "Contract End Date: ", new { data_translate = "endDate" })
                                           
                                        </td>
                                        <td>
                                            @Html.DisplayFor(model => model.contractenddate)
                                        </td>

        

    //EditDetails.cshtml

    EndDate = $("#contractenddate").val();
            $("#contractenddate").focusout(function () {
                alert("Hi");
                var contractEndDate = new Date($("#contractenddate").val());
                var today = new Date();
                var targetDate = new Date();
                targetDate.setDate(today.getDate() + 180);
                targetDate.setHours(0);
                targetDate.setMinutes(0);
                targetDate.setSeconds(0);


                if ((Date.parse(targetDate) > Date.parse(contractEndDate)) && Date.parse(contractEndDate) > Date.parse(today)) {
                    // alert('Within Date limits');
                    $("#contractenddate").closest('td').find('span').removeClass("field-validation-error")
                    $("#contractenddate").closest('td').find('span').addClass("field-validation-valid")
                    $("#contractenddate").addClass("valid");
                    $("#contractenddate").removeClass("input-validation-error");
                } else {
                    $("#contractenddate").closest('td').find('span').addClass("field-validation-error")
                    $("#contractenddate").closest('td').find('span').removeClass("field-validation-valid")
                    $("#contractenddate").removeClass("valid");
                    $("#contractenddate").addClass("input-validation-error");
                }
            });

    Regards,

    Sudheer


    Thanks & Regards, Sudheer

    Friday, December 7, 2018 2:59 AM

All replies

  • Hi,

    Internet Explorer 11 does not currently support <input type='date'> please refer the below article from  Microsoft road map Article "

    Inputting dates in a form is common practice on the Web. We’re beginning the implementation of a variety of new input controls for basic date picking. These controls will use the standard HTML5 types and provide UI that’s friendly to your input device, like our other HTML5 input controls.

    "

    https://blogs.msdn.microsoft.com/ie/2014/12/08/status-roadmap-update-srcset-main-element-and-date-inputs-in-development/


    Tuesday, December 18, 2018 8:21 PM