Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda