NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
862 stars 170 forks source link

Inaccurate date sort #41

Closed yrara closed 10 years ago

yrara commented 10 years ago

Currently, the tableSorter parser for the errorDate column doesn't subtract the month parameter by one, to account for the fact that months in JavaScript DateTime are 0-indexed.

This results in the following issue: March 31st and April 1st are parsed as new Date(2014, 3, 31, ...) and new Date(2014, 4, 1), respectively, which are both interpreted as May 1st, as April (month 3 in JavaScript) has only 30 days, and thus rolls over to May.

The date parser needs an additional -1 in the month parameter, else March 31st and April 1st, and other dates like them, cannot be internally sorted.

https://github.com/NickCraver/StackExchange.Exceptional/blob/master/StackExchange.Exceptional/Resources/Scripts.js#L55

NickCraver commented 10 years ago

Fixed, thanks!