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

121
Vistas
How to custom format date with javascirpt and jquery

I am trying to set the date with a formatted date but I don't know how to do that can you please help me to do it. the default i get is "17/11/201" but i want "Nov 17, 20021" and how to disable past dates with this code thank you so much for helping me

const input = document.createElement('input');

input.type = "date"
input.id = "scheduleTime"
input.className = "input-text";
input.value = new Date(Date.now()).toLocaleDateString('en-CA');
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

new Date().toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })

More info is here.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString

Regards to past dates try to use the min attribute. Examples are here. https://www.w3schools.com/tags/att_input_min.asp

about 4 years ago · Juan Pablo Isaza Denunciar

0

If it was me i would use the moment.js library

It allows you to do the following:

moment().format('MMM DD, YYYY')

As apposed to the native solution, which would be something along the lines of:

new Date(Date.now()).toLocaleString('en-CA', { month: 'short', day: 'numeric', year: 'numeric' });
about 4 years ago · Juan Pablo Isaza Denunciar
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