Skip to content

Reset Ngx Bootstrap Inline Date Range Picker #6401

Open
@rahulk0310

Description

@rahulk0310

I am trying to reset the inline date range picker selection on click of a button. As soon as I click on the reset button Value change event is not emitting.

<bs-daterangepicker-inline
	[minDate]="minDate"
	[bsValue]="bsInlineRangeValue"
        [bsConfig]="{
		showWeekNumbers: false,
		preventChangeToNextMonth: true
	}"
	(bsValueChange)="onValueChange($event)"
></bs-daterangepicker-inline>
<br>
<a style="display: block" (click)="reset()">Reset</a>
minDate = new Date();
maxDate = new Date();
bsInlineRangeValue!: Date[];

constructor() {
         this.maxDate.setDate(this.maxDate.getDate() + 7);
         this.bsInlineRangeValue = [new Date(), this.maxDate];
}

onValueChange(value: any): void {
	console.log(value);
        //Not firing after reset
}

reset() {
	this.bsInlineRangeValue = [];
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions