Angular-Material DateTime Picker Component?

Kevin Curnow picture Kevin Curnow · Feb 6, 2018 · Viewed 91k times · Source

I imported a date picker in a project and was wondering if there was any official recent component from angular and material to include time in the calendar as well.
I've seen plenty of time pickers in material documentation and researched a lot of third party ones, but they seem very complex.

Answer

Maurice picture Maurice · Feb 26, 2019

You can have a datetime picker when using matInput with type datetime-local like so:

  <mat-form-field>
    <input matInput type="datetime-local" placeholder="start date">
  </mat-form-field>

You can click on each part of the placeholder to set the day, month, year, hours,minutes and whether its AM or PM.