Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yavor-htmlelements opened this issue Sep 16, 2021 · 0 comments

Comments

@yavor-htmlelements
Copy link

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();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant