-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set locale 'it': Type '{ locale: string; }' has no properties in common with type 'IDatePickerDirectiveConfig' #604
Comments
Please provide a stackblitz |
i can confirm the issue. maybe we need a better documentation on how to set (or load) the locale in "dayjs way" |
@FrancYescO can you provide a stackblitz? |
not much to do, just add https://stackblitz.com/edit/angular-s5bfkr?file=src%2Fapp%2Fapp.component.ts |
init dayjs: dayjs.locale(languageCode); |
Just started using this component and ran into this issue. Looking forward to a fix hopefully in the not too distant future. |
At last I've managed to change the locale. Did not find an information anywhere! In *.ts file I added
And in the same file in constructor: Also I had to add to tsconfig.app.json: In package.json I have |
Make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information.
What's the version of Angular you're using?
13.3.11
Does this occur on specific browser?
No
Provide a minimal code snippet, please make sure it is well formatted.
I have an input from a reactiveForm like this:
<input type="text" class="form-control form-control-lg form-control-solid" placeholder="01/01/2031" name="data" formControlName="data" [dpDayPicker]="datepickerConfig" theme="dp-material" />
I have to change the locale of dpDayPicker to italian, so
datepickerConfig
is setted this way:datepickerConfig = { locale: 'it' };
But on compile I receive the following error:
`
Error: src/app/pages/data-page/page-form.component.html:111:18 - error TS2559: Type '{ locale: string; }' has no properties in common with type 'IDatePickerDirectiveConfig'.
111 [dpDayPicker]="datepickerConfig"
~~~~~~~~~~~
src/app/pages/data-page/page-form.component.ts:19:16
19 templateUrl: './page-form.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component FormComponent.
✖ Failed to compile.`
What am I doing wrong?
The text was updated successfully, but these errors were encountered: