unicorn-components
Version:
<a target="_blank" href="https://getunicorn.io"><img src="https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2017/Jul/07/2615006260-5-nitsnetsstudios-ondemand-UNI_avatar.png" align="left"></a>
46 lines (36 loc) • 1.18 kB
text/typescript
import { Component, ElementRef, EventEmitter, HostBinding, Input, Output } from '@angular/core';
import { UniInputBaseComponent } from '../../base/input-base/input-base.component';
export class UniDatetimePickerComponent extends UniInputBaseComponent {
componentClass = true;
timeLabel: String;
dateLabel: String;
floating = true;
maxDate;
minDate;
maxTime;
minTime;
rangeFrom;
rangeTo;
constructor(private elementRef: ElementRef) {
super();
}
onDateChanges(date) {
const newModel = this.model || {};
newModel['date'] = date;
this.modelChange.emit(newModel);
}
onTimeChanges(time) {
const newModel = this.model || {};
newModel['time'] = time;
this.modelChange.emit(newModel);
}
clear() {
this.onDateChanges(null);
this.onTimeChanges(null);
}
}