如何使用ng-pick-datetime选择器更改月份和星期几的名称?

时间:2019-09-30 17:10:02

标签: angular datetimepicker

我使用的是ng-pick-datetime选择器,需要更改月份和工作日的名称。我试图在owl-date-time中设置属性[locale] =“ es”,但该属性无法识别。有人遇到过同样的问题吗?还有其他修改标签名称的方法,例如示例: 'https://www.pika.dev/packages/ng-pick-datetime-highlight'

我尝试过的代码如下:

export class MyModel {

  en: any;

  ngOnInit() {
    this.en = {
      firstDayOfWeek: 0,
      dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
      dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
      monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
      monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
    };
  }
}
<owl-date-time [(ngModel)]="dateValue" [locale]="en"></owl-date-time>

我收到错误消息:'Can't bind to 'locale' since it isn't a known property of 'owl-date-time'.

0 个答案:

没有答案