Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Default Input value for datetime-local

I have a fairly simple date time picker in angular, similar to docs https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

<input type="datetime-local" value="2017-06-01T08:30">

This works fine if I want a fixed hardcoded date. But I want the default value to be a variable, so i can use current date and time. I tried using value="someVar" where someVar = "2017-06-01T08:30", but the value is not read. So it looks like hardcoded date is working, stored date is not. Suggestions? Thanks!

edit: I can't share the ts code, but I have this for the date var

export class someComp { someVar: string = "2017-06-01T08:30"

etc...

}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you just need to send the 'someVar' to input, use [value]="someVar".

If you want to have 'someVar' potentially changable by some logic later (in ts) use value="{{someVar}}".

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda