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

153
Views
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 answers
Answer question

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 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!