Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

265
Visualizações
Date Picker control not working as expected for 'dd-mm-yyyy' format in MS Edge

I am using the Datepicker via bootstrap JavaScript. I have this code:

<div class="col-sm-4">
@Html.TextBoxFor(m => m.Trust.EstablishmentDate, "{0:dd-MM-yyyy}", new { id = "establishmentDate", @readonly = "readonly", @class = "datefield form-control" })               
 @Html.ValidationMessageFor(m => m.Trust.EstablishmentDate, null, new { @class = "help-block" })
</div>                                               
 $(document).ready(function () {
       $("#establishmentDate").datepicker({
        changeMonth: true,
        changeYear: true,
        format: 'dd-mm-yyyy',                    
    });
});

The above code worked fine while publishing it in IE, displaying and recognizing the date in the required dd-mm-yyyy format from date picker.

But the same code is not working as expected in the Edge browser where the below error is getting prompted: The required field must be a date.

It's recognizing the format as mm-dd-yyyy and hence the above error appears when it finds the month as invalid for the cases like 22-06-22, where as for cases like 02-06-22, its recognizes as 6th Feb.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda