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

220
Views
Read date value using two way binding typescript

I am using default date input HTML element to render datepicker in my page. But, the default value in the page is showing as "mm/dd/yyyy" even after two way binding is applied. What is wrong with below code?

My HTML page:

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

My .ts file

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

When i read "todayDate" value, i am getting right value. But in UX, the default value is showing as "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"/>

I think your code must be like that.

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!