tediousjs / tedious

Node TDS module for connecting to SQL Server databases.

Home Page:http://tediousjs.github.io/tedious/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pre 2001 Dates throws Out of Range Error when using params

LoreIsRobot opened this issue · comments

Software versions

  • Tedious: 16.7.0

Problem description
I'm using TypeOrm in a project and it all of a sudden started to fail to update with pre 2001 dates. I can see in the commit for 16.7.0 (19cb073) that the unit tests expect it to fail for 2000-12-31 (test/unit/data-type.js lines 218, 323, 388). There is an issue with the min date. I'll see if I can fix it, but wanted it out here at least in the meantime.

Hey, thanks for reporting this! ❤️

@MichaelSun90 will also look into it, in case you don't have the time to dig into the source code.

It appears that 'January 1, 0001' is being parsed as 2001. It's all over the board what Date is parsing things as though. Passing in integer values returns 1901 🤷. I've been using Dayjs now for a while, I'll need to refresh myself.

🎉 This issue has been resolved in version 16.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀