Angular date & time picker
Simple responsive Angular date and time picker.
Demo
Basic usage
View on GitHub<input class="form-control" [(ngModel)]="date" placeholder="Date and time" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker></nxt-date-time>
Calendar only
View on GitHub<input class="form-control" [(ngModel)]="date" placeholder="Date" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker pickerType="calendar"></nxt-date-time>
Time only
View on GitHub<input class="form-control" [(ngModel)]="date" placeholder="Time" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker pickerType="timer"></nxt-date-time>
Trigger via an icon
View on GitHub<div class="input-group"> <input class="form-control" [(ngModel)]="date" placeholder="Date and time" [nxtDateTime]="picker"> <nxt-date-time #picker></nxt-date-time> <button class="btn btn-outline-secondary" type="button" [nxtDateTimeTrigger]="picker"> <svg viewBox="0 0 16 16"> <path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z"></path> <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"></path> </svg> </button> </div>
Select range
View on GitHub<input class="form-control" [(ngModel)]="range" placeholder="Date time tange" selectMode="range" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker></nxt-date-time>
Min and max date
View on GitHub<input class="form-control" placeholder="Date Time:" [(ngModel)]="date" [min]="min" [max]="max" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker [startAt]="startAt"></nxt-date-time>
Filter available dates
View on GitHub<input class="form-control" placeholder="Date and time" [(ngModel)]="date" [dateTimeFilter]="filter" [nxtDateTimeTrigger]="picker" [nxtDateTime]="picker"> <nxt-date-time #picker></nxt-date-time>