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

211
Views
Leer el valor de la fecha usando mecanografiado de enlace bidireccional

Estoy usando el elemento HTML de entrada de fecha predeterminado para representar el selector de fecha en mi página. Pero, el valor predeterminado en la página se muestra como "mm/dd/yyyy" incluso después de aplicar el enlace bidireccional. ¿Qué está mal con el siguiente código?

Mi página HTML:

 <div class='input-group date datepicker'> <input id="dtDate" type="date" [(ngModel)]="todayDate" /> </div>

Mi archivo .ts

 private todayDate = new Date().toLocaleDateString();

Cuando leo el valor "todayDate", obtengo el valor correcto. Pero en UX, el valor predeterminado se muestra como "mm/dd/yyyy".

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

<input [ngModel]="todayDate | date:'yyyy-MM-dd'" (ngModelChange)="todayDate = $event" type="date" name="todayDate"/>

Creo que tu código debe ser así.

over 4 years ago · Santiago Trujillo 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!