cibernox / ember-power-calendar

Powerful and customizable calendar component for Ember
http://www.ember-power-calendar.com
Other
211 stars 118 forks source link

How to create a custom ember-power-calendar-plugin ? #300

Closed Shishouille closed 7 months ago

Shishouille commented 2 years ago

Hi guys,

We want to transition from moment to dayjs in our project, without adding another date library. The problem is we can't create a custom ember-power-calendar plugin that is not with luxon or moment. I tried to create an addon by doing the same method that is used in ember-power-calendar-date-fns: create a funnel to /ember-power-calendar-utils, but it doesn't seem to work, and I have no idea why (maybe because of embroider if we see a related issue ?).

I was wondering if we could add a way to import our own plugin without the calendar to fail at build ? I don't know if the method already exists but I didn't see it or get it yet. Maybe instead of checking if ember-power-calendar-moment or ember-power-calendar-luxon exists, only to check if ember-power-calendar-* exists and only throw errors if a method is missing ?

Thanks for the help.

mkszepp commented 7 months ago

Sry for delay

Since v0.21 it is easy to make a custom meta package.

As base how it works you can look to moment / luxon meta addons

Moment: https://github.com/cibernox/ember-power-calendar-moment/tree/v0.6.1/ember-power-calendar-moment

Luxon: https://github.com/cibernox/ember-power-calendar-luxon/tree/v0.8.1/ember-power-calendar-luxon

If you need any help let me know