Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

64
Views
¿Cómo visualizo la salida del día como jueves 16 de diciembre en lugar de MM/DD en CSS/HTML?

Estoy tratando de descubrir cómo mostrar este código de una manera más fácil de usar, por ejemplo, en lugar de mostrarlo como MM/DD ex. "12/20" Prefiero que diga Nombre del día, las 3 primeras letras del mes y el DD, por ejemplo, "Lunes, 20 de diciembre". ¿Es eso posible? Encuentre el código a continuación.

 /* 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 answers
Answer question

0

  1. Uso de JS Date para mostrar la fecha en el formato anterior.

 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. Uso de 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!