1

I am using the library ngx-mat-datetime-picker from angular-material-components to get datetime selection. It is working well so far, but I need to be able to set text in front of the hours and minutes, like 'HH' and 'MM'.

What I have is:

enter image description here

And what I am looking for is something like this:

enter image description here

Can someone help with that?

This is the code I have:

        <mat-form-field>
          <input matInput [ngxMatDatetimePicker]="dateStart" placeholder="Date Start" [(ngModel)]="dS" disabled>
          <mat-datepicker-toggle matSuffix [for]="dateStart"></mat-datepicker-toggle>
          <ngx-mat-datetime-picker #dateStart disabled="false"></ngx-mat-datetime-picker>
        </mat-form-field>

1 Answer 1

1

i'm using version @angular-material-components/datetime-picker @7.0.0 and this behavior is included by default, also you can use [stepHour], [stepSecond] and [stepMinute] attributes to control steps size

<ngx-mat-datetime-picker #picker
      [stepHour]="1" 
      [stepSecond]="10" 
      [stepMinute]="5" 
      [enableMeridian]="true">
</ngx-mat-datetime-picker>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.