Unhandled Promise rejection: date.getDate is not a function ; Zone: angular ; Task: Promise.then ; Value: TypeError: date.getDate is not a function
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.formatDate (calendar.js:914)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.formatDateTime (calendar.js:373)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.updateInputfield (calendar.js:338)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.writeValue (calendar.js:864)
at forms.es5.js:1845
at forms.es5.js:3040
at Array.forEach (
at FormControl.webpackJsonp.../../../forms/@angular/forms.es5.js.FormControl.setValue (forms.es5.js:3040)
at forms.es5.js:4449
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388) TypeError: date.getDate is not a function
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.formatDate (http://localhost:4200/vendor.bundle.js:42312:93)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.formatDateTime (http://localhost:4200/vendor.bundle.js:41771:39)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.updateInputfield (http://localhost:4200/vendor.bundle.js:41736:39)
at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.writeValue (http://localhost:4200/vendor.bundle.js:42262:14)
at http://localhost:4200/vendor.bundle.js:138317:29
at http://localhost:4200/vendor.bundle.js:139512:65
at Array.forEach (
at FormControl.webpackJsonp.../../../forms/@angular/forms.es5.js.FormControl.setValue (http://localhost:4200/vendor.bundle.js:139512:28)
at http://localhost:4200/vendor.bundle.js:140921:60
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:4200/polyfills.bundle.js:2933:26)
I had this issue because my model was not a Date but a string. It exists dataType property but there is no options to define h, s, ms...
I suggest to transform your model to Date.
https://www.primefaces.org/primeng/#/calendar
Not a PrimeNG issue and not a valid issue ticket.
Most helpful comment
I had this issue because my model was not a Date but a string. It exists dataType property but there is no options to define h, s, ms...
I suggest to transform your model to Date.
https://www.primefaces.org/primeng/#/calendar