mat-datetimepicker icon indicating copy to clipboard operation
mat-datetimepicker copied to clipboard

show different labels when datetime

Open NiZelooer opened this issue 6 years ago • 3 comments

I have 2 input fields.

image

Both input fields are type="datetime". But the label from number 1 should be the label from date. The label from number 2 should be the label from time. For example: number 1: input="datetime" the label in input should be DD.MM.YYYY number 2: input="datetime" the label in input should be HH:mm

Is there any way to make this?

NiZelooer avatar Feb 19 '19 11:02 NiZelooer

You need the type to be "time" in order to use that format (HH:mm).

sapabg avatar May 30 '19 11:05 sapabg

@sapabg I want to set the date and time in both fields but show only the date in the date field and only the time in the time field.

NiZelooer avatar Jun 04 '19 13:06 NiZelooer

I think that no matter what you show in the field it will always return a Date() object when you submit it. The type property only defines what to be shown in the input. I'll try to do an example later.

sapabg avatar Jun 04 '19 14:06 sapabg