Skip to content
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

Support Luxon date adapter and formater for variable timezone setting #1661

Open
dominikbrazdil opened this issue Apr 19, 2023 · 6 comments
Open

Comments

@dominikbrazdil
Copy link

Is your feature request related to a problem? Please describe

I need to use the calendar in different timezone from user's local one. Currently I am using Moment adapter and formatter as I was not able to implement those using date-fns-tz by myself (tried rewriting all adapter functions to work with converted Dates as described here marnusw/date-fns-tz#67).

But MomentJS is deprecated now and increases the bundle size a lot.

Describe the solution you'd like

In our project we are thinking about using Luxon library (as direct successor of Moment) instead of date-fns-tz and it would be nice if calendar would support this out of the box without need to implement own adapter and formatter.

Describe your use case for implementing this feature

This would make timezone handling in calendar up-to-date with latest libraries and remove the hassle with painful timezone debugging

Additional context

@matts-bot
Copy link

matts-bot bot commented Apr 19, 2023

Thanks so much for opening an issue! If you'd like to support this project, then please consider sponsoring me

@lino
Copy link

lino commented Jul 6, 2023

I see two tasks here.

Implementation of luxon based adapter

Possibly there is a way to do this without breaking the moment based adapters.

Deprecation of moment.js

This would possibly reduce bundle size and keep the deprecated library out of the project.
Depending on if there's a way to do this without breaking, this would possibly something only applicable with a major release.

As I need to remove moment.js from a project, I'd be glad to help with achieving this.

@billyjov
Copy link
Collaborator

billyjov commented Oct 5, 2023

@lino @dominikbrazdil The current implementation already support date-fns as replacement of moment. But sure it will be nice to have support for other adapater.

@lino
Copy link

lino commented Oct 5, 2023

@lino @dominikbrazdil The current implementation already support date-fns as replacement of moment. But sure it will be nice to have support for other adapater.

Oh, I didn't realize that. It's still on my to-do list, though. Thanks for the heads up and the reminder.

@dominikbrazdil
Copy link
Author

@billyjov 'date-fns' adapter does not work with different timezones than the local one (you need to use date-fns-tz library)

@billyjov
Copy link
Collaborator

billyjov commented Oct 5, 2023

@dominikbrazdil sure.. there is no support out of the box. so you have to combine date-fns and date-fns-tz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants