-1

カレンダー コントロールに値を設定したいのですが、下の行で次のエラーが発生し、値も設定されません。

this.data.dateIn = this.selecteddata.dateIn;

<p-calendar [(ngModel)]="data.dateIn" [showIcon]="true" name="dateInCalendar"   
             required #dateInCalendar="ngModel">
</p-calendar>

エラーエラー: キャッチされていません (約束されています): TypeError: date.getMonth is not a function TypeError: date.getMonth is not a function at Calendar.webpackJsonp.../../../../primeng/components/calendar/ calendar.js.Calendar.formatDate (calendar.js:649) で Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.updateInputfield (calendar.js:252 ) Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.writeValue (calendar.js:595) at forms.es5.js:1779 at forms.es5 .js:2965 at Array.forEach () at FormControl.webpackJsonp.../../../forms/@angular/forms.es5.js.FormControl.setValue (forms.es5.js:2965) at フォーム。 es5.js:4367 at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:365) で Object.onInvoke (core.es5.js:3890) で ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone. js:364) で Zone.webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:125) で zone.js:758 で ZoneDelegate。 webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:398) を Object.onInvokeTask (core.es5.js:3881) でカレンダーに表示します。 webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar.formatDate (calendar.js:649) at Calendar.webpackJsonp.../../../.. /primeng/components/calendar/calendar.js.Calendar.updateInputfield (calendar.js:252) at Calendar.webpackJsonp.../../../../primeng/components/calendar/calendar.js.Calendar. form.es5.js の writeValue (calendar.js:595):FormControl.webpackJsonp.../../../forms/@angular/forms.es5.js.FormControl.setValue (forms.es5.js: 2965) Forms.es5.js:4367 で ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:365) オブジェクトで。 onInvoke (core.es5.js:3890) で ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:364) でゾーン。 webpackJsonp.../../../../zone.js/dist/zone.js.Zone.run (zone.js:125) at zone.js:758 at ZoneDelegate.webpackJsonp.../.. /../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:398) で Object.onInvokeTask (core.es5.js:3881) で resolvePromise (zone.js:710) [ angular] at :4200/polyfills.bundle.js:7469:17 [角度] Object.onInvokeTask (core.es5.js:3881) [角度] DrainMicroTaskQueue (zone.js:591) [] XMLHttpRequest.ZoneTask.invoke (zone.js:464) []

4

2 に答える 2