You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the implementation of checkDate() in the app component looks like this
checkDate(): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } => {
console.log('date from : ', this.abc.efg.fromDate);
// other implementation
}
}
The issue I am facing is that, whenever I pick a date (by clicking the icon), I get call in the checkDate() and the value of this.abc.efg.fromDate is not the value I picked from the date picker, in fact it is the previous value in the date field.
How can I solve this ? assuming that the ngModel should have the updated value even if I am using the icon.
Won't the ngModel get updated as soon the date is picked from the date picker icon ?
PS: this.abc.efg.fromDate is a date field.
Environment
Angular UI with Primeng calendar
Reproducer
No response
Angular version
14.2.13
PrimeNG version
9.1.12
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.10.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered:
jithinpathrose
changed the title
Primeng calendar not updating the value of date in ngModelComponent: Title
Primeng calendar not updating the value of date in ngModel
Jan 17, 2024
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?
Thanks a lot for your understanding!
Best Regards,
Describe the bug
I am trying to use an
p-calendar
with icon like thisand the implementation of checkDate() in the app component looks like this
The issue I am facing is that, whenever I pick a date (by clicking the icon), I get call in the checkDate() and the value of
this.abc.efg.fromDate
is not the value I picked from the date picker, in fact it is the previous value in the date field.How can I solve this ? assuming that the ngModel should have the updated value even if I am using the icon.
Won't the
ngModel
get updated as soon the date is picked from the date picker icon ?PS:
this.abc.efg.fromDate
is a date field.Environment
Angular UI with Primeng calendar
Reproducer
No response
Angular version
14.2.13
PrimeNG version
9.1.12
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.10.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: