Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda