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

65
Vistas
How do I display the day output as Thursday, Dec 16 rather than MM/DD in CSS / HTML

I am trying to figure out how to display this code in a more user friendlier manner for example instead of displaying as MM/DD ex. "12/20 " I would rather it say Name of day , first 3 letters of the month and the DD for example " Monday, Dec 20 " . Is that possible? Please find the code below.

/* js file for autocalculate shipping*/
(function() {
// estimate the delivery date  
  var dateEnd = 3;
  var toDate = Date.today().addDays(dateEnd);
  if (toDate.is().saturday() || toDate.is().sunday()) { 
    toDate = toDate.next().monday(); 
  }
  document.getElementById('toDate').innerHTML = toDate.toString('MM/dd');
})();
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

  1. Using JS Date to display Date in the above format.

const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
const months = ["Dec","Nov","Oct","Sep","Aug","Jul","Jun","May","Apr","Mar","Feb","Jan"]

const getFormattedDate = (date) => {
  return `${days[date.getDay()]} - ${months[date.getMonth()]} - ${date.getFullYear()}`
}


let d = new Date();
console.log(getFormattedDate(d))

  1. Using Moment JS https://momentjs.com/

let date = moment()
console.log(date.format('ddd MMM YY'))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

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