Skip to content

jqxDateTimeInput formControl.setValue() and formControl.reset() issues in Angular  #450

@yavor-htmlelements

Description

@yavor-htmlelements

jqxDateTimeInput with range selection, min and max date when formControl.setValue() mehtod is used it removes the min and max date restrictions and the user can select other dates.

When using the formControl.reset() method in the same setup the popup calendar dates inside of it are displayed as NaN.
Screenshot_42

Code for reproducing the issue:
In app.component.html

<jqxDateTimeInput
	placeHolder="Plaholder here" 
	#myDateTimeInput 
	selectionMode="range" 
	[min]="minDate"
	[max]="maxDate"
	[formControl]= "date"
	(onValueChanged)="dateChange($event)">>
</jqxDateTimeInput>
<p>{{date.value}}</p>
<button (click)="setValue($event)">Set Value</button>
<button (click)="resetValue($event)">Reset Value</button>

app.component.ts:

    date = new FormControl(new Date(2021, 8, 1, 12, 0, 0));
    maxDate = new Date();
    minDate: any = new Date(2021, 8, 10);
    
    dateChange = (event: Event):void => {
        console.log(event);

    };
    setValue():void {
        this.date.setValue({});
    }
    resetValue():void {
        this.date.reset();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions