mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 866 forks source link

feat: add luxon date adapter #1709

Open angelaki opened 5 months ago

angelaki commented 5 months ago

I'm switching my project from moment to luxon so I needed luxon support in your (great!) calendar control.

I'm not very familiar with package building but hope I've adopted all the necessary files for a correct luxon support. By the way, since your CalendarNativeDateFormatter uses the Intl object (and I guess for that reason there is no CalendarDateFnsDateFormatter), why is there even a CalendarMomentDateFormatter? Any reason to use it at all?

Thank you for checking, probably some fixing ;) & deploying! :)

angelaki commented 5 months ago

Guess it sure doesn't work, yet. But what does that line in the old moment dateAdapter even do?

https://github.com/mattlewis92/angular-calendar/blob/4b34012ae4125ef68b4049284186dc966b2413bf/projects/angular-calendar/src/date-adapters/moment/index.ts#L6

Just copied it - but actually don't get it.

mattlewis92 commented 5 months ago

By the way, since your CalendarNativeDateFormatter uses the Intl object (and I guess for that reason there is no CalendarDateFnsDateFormatter), why is there even a CalendarMomentDateFormatter? Any reason to use it at all?

I can't remember the exact reasoning, but I think at the time the Intl API was really buggy in most browsers (which was why angular moved away from it), so I added moment as a "stable" alternative. I think nowadays angular are looking to move back to the Intl api so I guess it got better and having the other date formatters makes less sense.

JaxonWright commented 1 month ago

@mattlewis92 any idea on when this can get added? I just started working on a new project and this feature would make things a lot easier

mattlewis92 commented 1 month ago

@mattlewis92 any idea on when this can get added? I just started working on a new project and this feature would make things a lot easier

Feel free to send another PR based off this one with the review comments addressed :) It's not something I have the time to work on myself