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

Proposal: utilize date-io to create adapters for svelte-gantt #235

Open
AndreyYolkin opened this issue Jul 23, 2024 · 2 comments
Open

Proposal: utilize date-io to create adapters for svelte-gantt #235

AndreyYolkin opened this issue Jul 23, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@AndreyYolkin
Copy link

At the current moment, svelte-gantt only supports JSDate/moment adapters. However, there are more date-managing libs nowadays and adapters can reduce output size reusing them instead of JSDate adapter. To make writing adapters easier, I suggest to look at https://github.com/dmtrKovalenko/date-io and add support for other libs while using consistent api.

If you find it reasonable, I'm willing to help with the implementation

@AndreyYolkin
Copy link
Author

If you want to keep project dependency-free, I also respect this decision, then I want to help with other libs (luxon, dayjs, dayfns) adapters

@ANovokmet
Copy link
Owner

Hi, of course! Currently adapters are used for formatting (displaying labels) and rounding (needed when dropping a task), but otherwise dates are used as numbers (UNIX timestamps) which I am happy with. The rounding was an issue when we ditched moment.js and people started reporting incorrect times when in some time zones (eg. UTC+5:30). Since svelte-gantt is from recently a monorepo you could create a new package eg. svelte-gantt/date-io.

Another thing I would like to have is cleaning up the default (JS Date) adapter, so that maybe the roundTo function is more robust.

@ANovokmet ANovokmet added the enhancement New feature or request label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants