Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

 

In Angular Material + HTML5 you can use an input from the Type Date to automatically display a calendar control for dates.

The input Type=Date is assigned as a string and read

as here: "2021-01-20"

 

 

 

Conversion JSON / Angular Date to input Type Date

 

    //*convert Iso-Date-Time to Javascript Date: 2021-01-20T08:00:00

    this.sDateStartthis.get_Date_String_from_Date(this.dtStart);

 

Conversion JSON / Angular Date to input Type Date

 

  get_Date_String_from_DatedtDate:Date ) : String {

    //----< get_Date_String_from_Date() >----

    //*convert Typescript Date: 2021-01-20T08:00:00 to Time-String "08:00"

    let sDateTime : string = dtDate.toString();

    let sDateString = sDateTime.substr(0,sDateTime.indexOf("T"));

    

    return sDate;

    //----</ get_Date_String_from_Date() >----

  }

 

 

For the Angular->component.html output

 

        <mat-form-field style="width:130px;">

            <mat-label>Date</mat-label>

            <input type="date" name="ctlsDateStart" matInput [(ngModel)]="sDateStart" >

        </mat-form-field>&nbsp;

 

Mobile

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de