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

fix: days wrong if over 1 month #758

Closed
wants to merge 1 commit into from

Conversation

lzj960515
Copy link

No description provided.

@felixmosh
Copy link
Owner

Hi @lzj960515 can you elaborate?

@mariuszste
Copy link

I think there is a bit more work to do here. Passing a duration to js Date (it takes a unix timestamp) is just a bad idea in general because a duration is fundamentally not a date. The current solution just happens to work for a while since 0 is january first 1970 at midnight, but as soon as the uptime is longer than a month it switches to february and breaks.

Personally not a fan of reinventing the wheel when dealing with time. luxon is already a dependency of cron-parser and both bull and bullmq depend on it. So might as well use a battle tested solution that handles all the edge cases and even can do formatting using browser's native intl, so we get multi language support for free

@felixmosh felixmosh closed this in bf7e356 May 30, 2024
@felixmosh
Copy link
Owner

@mariuszste thank you for the explanation, this piece of code is old...
I've moved formatting to the client, so it will be localized.
image
Thanks for pointing this out

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

Successfully merging this pull request may close these issues.

3 participants