1

I am trying to use the event onValueChange, according to the PrimeNG documentation, but it does not work.

View

<p-calendar (onValueChange)="changeFechaFinEstimada()" [(ngModel)]="empleado.fechaFinEstimada" [locale]="es" dateFormat="dd-mm-yy"
                            [showIcon]="true" name="fechaFinEstimada" id="field_caducidad" [monthNavigator]="true" [yearNavigator]="true"
                            yearRange="2018:2030"></p-calendar>

Controller

changeFechaFinEstimada() {
    console.log(empleado);
}
Antikhippe
  • 6,316
  • 2
  • 28
  • 43
Jose
  • 1,779
  • 4
  • 26
  • 50

1 Answers1

1

onValueChange event is not available for PrimeNG 5.2.4. It's only available from 6.0.0-beta.1 as you can see here.

Best way to know if something is available or not is to have a look at the code from the version you use.

5.2.4 => onValueChange does not exist

6.0.0-beta.1 => onValueChange exists

Antikhippe
  • 6,316
  • 2
  • 28
  • 43
  • I'm looking at the link you've put me. But I still do not see if you can or not, make an "onChange" of my date, and if I can, how to do it in version 5.2.4. Thanks for the help. – Jose Jun 07 '18 at 10:04
  • You can use `onSelect` event. – Antikhippe Jun 07 '18 at 10:06