Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular ng owl date time custom format

IN .HTML
=======
<input matInput [(ngModel)]="toDate" [owlDateTime]="dateTo"
     [value]="toDate | date: 'MM/dd/yyyy HH:mm'" owl-date-time="dateTo" readonly>
<owl-date-time #dateTo></owl-date-time>
<mat-icon matTooltip="Calendar" matSuffix [owlDateTimeTrigger]="dateTo"
     (click)="setDateTime(dateTo)">date_range</mat-icon>

IN .TS
======
setDateTime(dateTime) {
	dateTime.selected = dateTime.startAt = toDate;
}
 
PREVIOUS NEXT
Tagged: #angular #ng #owl #date #time #custom #format
ADD COMMENT
Topic
Name
4+5 =