twas icon indicating copy to clipboard operation
twas copied to clipboard

Wrong results given very old dates

Open kidonng opened this issue 5 months ago • 0 comments

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 avatar Sep 13 '24 09:09 kidonng