TimelordUK / node-sqlserver-v8

branched from node-sqlserver, SQL server driver compatible with all versions of Node
Other
135 stars 43 forks source link

`ConcreteColumnType.parseSS` method tampers with plain date strings #318

Closed gulshan closed 3 months ago

gulshan commented 6 months ago

The ConcreteColumnType.parseSS method in user.js file uses the RegExp value /(\d?\d)$/g. This matches any regular date strings like 2020-01-01. When the match is found the value of the parameter is changed to ~1900-01-01.

Please check this and make necessary corrections. Thanks in advance.

gulshan commented 6 months ago

I have made this temporary change to make plain date strings work in user.js file-

      parse (s) {
        if (!this.parseHHMMSS(s) && !this.parseMMSS(s) /*&& !this.parseSS(s)*/) {
          this.value = (typeof s === 'string') ? new Date(s) : s
        }
      }
TimelordUK commented 3 months ago

no tests break with this change, so i have merged it - thanks

gulshan commented 3 months ago

Thank you for checking this. Closing the issue.