Fix NaN Handling in processCommitTimestamps - #8874
Conversation
|
This pull request addresses the handling of invalid date strings in the |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Nice catch! Adding the \isNaN(date.getTime())\ check right after parsing the date string in \utils/dateHelpers.ts\ is a small but critical improvement. It cleanly prevents malformed timestamps from being misclassified as night commits. Thank you for fixing this silent classification bug. Looks good to me!
Summary of What Has Been Done
Added a guard to skip invalid date strings in
processCommitTimestamps. Whennew Date(dateString)produces an Invalid Date,isNaN(date.getTime())is now checked before readinghour. Invalid dates are skipped entirely instead of being silently classified as "night".Changes Made
utils/dateHelpers.ts: AddedisNaN(date.getTime())guard inprocessCommitTimestampsImpact it Made
Closes #8842
Note: Please assign this PR to the
tmdeveloper007account.