Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 设置FullCalendar的第一天不工作_Angular_Fullcalendar_Primeng - Fatal编程技术网

Angular 设置FullCalendar的第一天不工作

Angular 设置FullCalendar的第一天不工作,angular,fullcalendar,primeng,Angular,Fullcalendar,Primeng,我使用Angular 2和Priming的日程表,它使用FullCalendar。我希望一周的第一天是星期一,但我想我的代码一定有点不对劲。我在我的p-schedule元素中添加了[locale]=en,如下所示: <p-schedule [events]="events" [header]="headerConfig" (onEventClick)="handleEventClick($event)" [fixedWeekCount]="false" [locale]="en">&

我使用Angular 2和Priming的日程表,它使用FullCalendar。我希望一周的第一天是星期一,但我想我的代码一定有点不对劲。我在我的p-schedule元素中添加了[locale]=en,如下所示:

<p-schedule [events]="events" [header]="headerConfig" (onEventClick)="handleEventClick($event)" [fixedWeekCount]="false" [locale]="en"></p-schedule>

在这些变化之后,我的第一天仍然是星期天。我没有收到任何错误,但它就是不起作用。我做错了什么?

我对p-calendar的区域设置也有同样的问题。我将firstDayOfWeek:1移动到数组的末尾,它成功了:

    this.nl = {
        dayNames: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"],
        dayNamesShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"],
        dayNamesMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za"],
        monthNames: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"],
        monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
        firstDayOfWeek: 1
    };
这是我的html:

<p-calendar id="entityActiveSince" [showIcon]="true" [locale]="nl"
 dateFormat="dd-mm-yy" [readonlyInput]="true" [disabled]="saving"   
 [(ngModel)]="entity.ActiveSince" [monthNavigator]="true" 
 [yearNavigator]="true" yearRange="1990:2020" name="activeSince"></p-calendar>
组件1.ts:

option: Object;

ngOnInit() {
  this.option = {
    firstDay: 1
  };
}
component.html:

<p-schedule [options]="option"></p-schedule>

可能已经跳过了这里的枪,因此至少现在删除了答案,但如果可以的话,可以尝试使用firstDayOfWeek,尽管看起来firstDay是正确的方式。我用firstDayOfWeek替换了firstDayOfWeek,但它仍然不起作用。你用和我一样的方法编写html了吗?那么在您的情况下,您的p-calendar中有[locale]=nl吗?顺便说一下,我使用的是日程表,而不是日历,所以我的元素是p-Schedule。我不确定这是否有什么不同。我更新了我的帖子并添加了我们正在使用的HTML。我不认为时间表组件在翻译方面与日历组件的工作方式不同。
<p-schedule [options]="option"></p-schedule>