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

152
Views
¿El filtro con nueva fecha () acepta un formato diferente a aaaa-mm-dd?

Tengo una respuesta de mydatepicker en el siguiente formato

 { "isRange":false, "singleDate":{ "date":{ "year":2022, "month":5, "day":13 }, "jsDate":"2022-05-13T03:00:00.000Z", "formatted":"13-05-2022", "epoc":1652410800 }, "dateRange":null }

Tengo un filtro que usa la nueva fecha(), pero parece que no lo acepta aceptando la fecha en el valor dd-mm-yyyy y necesitaría mostrarlo así, no así yyyy-mm- dd

 filterPeriodos() { const d = new Date(this.formGeral.value.data.singleDate?.formatted + 'T23:59'); if (this.storeS.layout.emp.id === 1) { if(this.formGeral.value.entregaBool){ return this.periodos.filter( transpId => transpId.ativo === (1) && transpId.transporte_id === (this.metodoId) && transpId.week[d.getDay()] === 1 ) ; } } return this.periodos; }

¿Alguien tiene alguna sugerencia?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para obtener el final de un día, primero convierta el texto analizable en una fecha, luego manipule esa fecha.

 let object = this.formGeral.value.data; // for our sanity let jsDate = new Date(object.singleDate.jsDate); jsDate.setUTCHours(23,59,59,999);

Mantenga la cadena formatted para mostrarla, pero realice cualquier cálculo de fecha en el objeto de fecha real.

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!