Giter Site home page Giter Site logo

Cannot set locale 'it': Type '{ locale: string; }' has no properties in common with type 'IDatePickerDirectiveConfig' about angular-datepicker HOT 7 OPEN

Faycop avatar Faycop commented on June 10, 2024
Cannot set locale 'it': Type '{ locale: string; }' has no properties in common with type 'IDatePickerDirectiveConfig'

from angular-datepicker.

Comments (7)

vlio20 avatar vlio20 commented on June 10, 2024

Please provide a stackblitz

from angular-datepicker.

FrancYescO avatar FrancYescO commented on June 10, 2024

i can confirm the issue.
i think it was broken here https://github.com/vlio20/angular-datepicker/pull/573/files

maybe we need a better documentation on how to set (or load) the locale in "dayjs way"

from angular-datepicker.

vlio20 avatar vlio20 commented on June 10, 2024

@FrancYescO can you provide a stackblitz?

from angular-datepicker.

FrancYescO avatar FrancYescO commented on June 10, 2024

not much to do, just add locale: 'it' to the config, seems it was a breaking changes not cited while migrating to dayjs

https://stackblitz.com/edit/angular-s5bfkr?file=src%2Fapp%2Fapp.component.ts
(stackblitz was a clone and edit from one you posted in the past)

from angular-datepicker.

WClouter avatar WClouter commented on June 10, 2024

init dayjs: dayjs.locale(languageCode);

https://day.js.org/docs/en/i18n/changing-locale

from angular-datepicker.

jsstrellix avatar jsstrellix commented on June 10, 2024

Just started using this component and ran into this issue. Looking forward to a fix hopefully in the not too distant future.

from angular-datepicker.

dreich avatar dreich commented on June 10, 2024

At last I've managed to change the locale. Did not find an information anywhere!

In *.ts file I added

import 'dayjs/locale/ru';
import dayjs from "dayjs";

And in the same file in constructor:
dayjs.locale('ru')

Also I had to add to tsconfig.app.json:
"allowSyntheticDefaultImports": true
in "compilerOptions".

In package.json I have
"dayjs": "^1.11.7",

from angular-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.