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

Wrong results given very old dates #12

Open
kidonng opened this issue Sep 13, 2024 · 0 comments
Open

Wrong results given very old dates #12

kidonng opened this issue Sep 13, 2024 · 0 comments

Comments

@kidonng
Copy link

kidonng commented Sep 13, 2024

https://stackblitz.com/edit/stackblitz-starters-ragzif

const twas = require('twas');

console.log(twas(new Date(1972, 0, 1))); // 54 years ago (WTF?)
console.log(twas(new Date(1973, 0, 1))); // 52 years ago

I suspect is has something to do with code not assuming fixed duration in a year. At least this is worth a warning in the readme.

@kidonng kidonng changed the title Doesn't handle leap year Wrong results given very old dates Sep 13, 2024
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

No branches or pull requests

1 participant