kuhnroyal / mat-datetimepicker

Material datetimepicker for @angular/material
MIT License
153 stars 84 forks source link

Using type=time, direct input is allowed but parsed as date #29

Closed narthur157 closed 6 years ago

narthur157 commented 6 years ago

If you use this just for the timepicker (I also use it for the datetimepicker of course), with Moment, it tries to convert input into the field into a date. So entering "12:35" will result in "null" because it's not a date.

kuhnroyal commented 6 years ago

Make sure you set the parse format or use the default formats MAT_MOMENT_DATETIME_FORMATS.

 parse: {
    timeInput: "LT"
  },
narthur157 commented 6 years ago

Where do you set this? I use the default for my date format

narthur157 commented 6 years ago

Nevermind, I see now, this is a separate option