将语言环境添加到角度组件的指令中:
<input
type="text"
name="date"
mwlFlatpickr
[altInputClass]="'form-control'"
[(ngModel)]="post.date"
[altInput]="true"
[inline]="true"
[dateFormat]="'d.m.y'"
[locale]="'Portuguese'"
[defaultValue]="'today'"
[convertModelValue]="true">
尝试加载语言环境时,返回错误:
错误:flatpickr:无效的语言环境葡萄牙语
在 setupLocale (flatpickr.js:1910) 在 init (flatpickr.js:581) 在 FlatpickrInstance (flatpickr.js:2419) 在 _flatpickr (flatpickr.js:2438) 在 flatpickr (flatpickr.js:2463) 在 FlatpickrDirective.push。 ./node_modules/angularx-flatpickr/fesm5/angularx-flatpickr.js.FlatpickrDirective.ngAfterViewInit (angularx-flatpickr.js:295) 在 callProviderLifecycles (core.js:22416) 在 callElementProvidersLifecycles (core.js:22390) 在 callLifecycleHooksChildrenFirst (core .js:22380) 在 checkAndUpdateView (core.js:23316)