migration
This commit is contained in:
@@ -29,31 +29,37 @@ export class DurationpickerComponent implements OnInit, ControlValueAccessor {
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.days.valueChanges.subscribe(value => {
|
||||
if (value < this.model.days()) {
|
||||
this.model.subtract((this.model.days() - value), "days");
|
||||
} else {
|
||||
this.model.add((value - this.model.days()), "days");
|
||||
this.days.valueChanges.subscribe({
|
||||
next: (value) => {
|
||||
if (value < this.model.days()) {
|
||||
this.model.subtract((this.model.days() - value), "days");
|
||||
} else {
|
||||
this.model.add((value - this.model.days()), "days");
|
||||
}
|
||||
this.checkValue();
|
||||
}
|
||||
this.checkValue();
|
||||
})
|
||||
|
||||
this.hours.valueChanges.subscribe(value => {
|
||||
if (value < this.model.hours()) {
|
||||
this.model.subtract((this.model.hours() - value), "hours");
|
||||
} else {
|
||||
this.model.add((value - this.model.hours()), "hours");
|
||||
this.hours.valueChanges.subscribe({
|
||||
next: (value) => {
|
||||
if (value < this.model.hours()) {
|
||||
this.model.subtract((this.model.hours() - value), "hours");
|
||||
} else {
|
||||
this.model.add((value - this.model.hours()), "hours");
|
||||
}
|
||||
this.checkValue();
|
||||
}
|
||||
this.checkValue();
|
||||
})
|
||||
|
||||
this.minutes.valueChanges.subscribe(value => {
|
||||
if (value < this.model.minutes()) {
|
||||
this.model.subtract((this.model.minutes() - value), "minutes");
|
||||
} else {
|
||||
this.model.add((value - this.model.minutes()), "minutes");
|
||||
this.minutes.valueChanges.subscribe({
|
||||
next: (value) => {
|
||||
if (value < this.model.minutes()) {
|
||||
this.model.subtract((this.model.minutes() - value), "minutes");
|
||||
} else {
|
||||
this.model.add((value - this.model.minutes()), "minutes");
|
||||
}
|
||||
this.checkValue();
|
||||
}
|
||||
this.checkValue();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user