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

164
Views
Bind date value using InputMask

I have an Angular2 application with PrimeNG suite installed.

I need to implement a form with two input elements and use in order to manage two date values.

I tried to use InputMask applying a specific mask and it works, now I don't know how to covert the date from Italian format ( provided by the user ) to TypeScript/Javascript format in order to be able to post the data...

The code I have implemented is this:

<p-inputMask mask="99/99/9999" [(ngModel)]="offert.dateDelivery" formcontrolname="dateDelivery" placeholder="dd/mm/yyyy" [ngModelOptions]="{standalone: true}" slotChar="dd/mm/yyyy"></p-inputMask>

The property offert.dateDelivery binds a Date field of a class.

The problem is that the user is forced to insert the value in Italian format ( dd/mm/yyyy ) that is actually not acceptable as date from Javascript/Typescript function...

How can I manage this scenario ?

thanks

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I solved the problem by binding two different independents string variables and parsing them to the two date properties after user click... The solution is easiest than expected

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!