How to set the input control of type datetime-local to the current time

Discussão em 'Angular' iniciado por Janciu, Dezembro 19, 2024.

  1. Janciu

    Janciu Guest

    I am straggling to set the date and time of my input field of type datetime-local in Angular to the current time.

    Below is the section of my template html file.

    <form [formGroup]="form" (ngSubmit)="onSubmit()" *ngIf="isLoaded && !isAdmin">
    <div class="form-row">
    <div class="form-group col-5">
    <label>Date</label>
    <input type="datetime-local" formControlName="scheduledDate" class="form-control" />
    </div>
    </div>
    </form>


    I have tried the suggestion given on stackblitz Here but it gives me strange error ERROR Error: NodeInjector: NOT_FOUND [NgControl]

    Continue reading...

Compartilhe esta Página