mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
37 lines
966 B
TypeScript
37 lines
966 B
TypeScript
import { Component, Input, Optional } from '@angular/core';
|
|
import { ValueInputComponent } from '../value-input.component';
|
|
import { ControlContainer, NgForm } from '@angular/forms';
|
|
import { controlContainerFactory } from '../../../process-form.component';
|
|
|
|
/**
|
|
* Represents the user inputted value of a date parameter
|
|
*/
|
|
@Component({
|
|
selector: 'ds-date-value-input',
|
|
templateUrl: './date-value-input.component.html',
|
|
styleUrls: ['./date-value-input.component.scss'],
|
|
viewProviders: [ { provide: ControlContainer,
|
|
useFactory: controlContainerFactory,
|
|
deps: [[new Optional(), NgForm]] } ]
|
|
})
|
|
export class DateValueInputComponent extends ValueInputComponent<string> {
|
|
/**
|
|
* The current value of the date string
|
|
*/
|
|
value: string;
|
|
|
|
/**
|
|
* Initial value of the field
|
|
*/
|
|
@Input() initialValue;
|
|
|
|
ngOnInit() {
|
|
this.value = this.initialValue;
|
|
}
|
|
|
|
setValue(value) {
|
|
this.value = value;
|
|
this.updateValue.emit(value)
|
|
}
|
|
}
|