Skip to content

Fix NaN Handling in processCommitTimestamps - #8874

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8842-nan-hours-process-commit-timestamps
Aug 6, 2026
Merged

Fix NaN Handling in processCommitTimestamps#8874
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8842-nan-hours-process-commit-timestamps

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Added a guard to skip invalid date strings in processCommitTimestamps. When new Date(dateString) produces an Invalid Date, isNaN(date.getTime()) is now checked before reading hour. Invalid dates are skipped entirely instead of being silently classified as "night".

Changes Made

  • utils/dateHelpers.ts: Added isNaN(date.getTime()) guard in processCommitTimestamps

Impact it Made

  • Prevents malformed timestamps from corrupting time-of-day metrics
  • Fixes silent data classification bug

Closes #8842

Note: Please assign this PR to the tmdeveloper007 account.

@retenta-bot

retenta-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

This pull request addresses the handling of invalid date strings in the processCommitTimestamps function, ensuring that NaN values do not corrupt time-of-day metrics. This aligns with previous decisions made regarding this issue, which emphasized the importance of preventing silent data classification bugs. Thank you for your contribution, and feel free to reach out if you have any questions!

@retenta-bot retenta-bot Bot changed the title fix : handled NaN hours from invalid dates in processCommitTimestamps Fix NaN Handling in processCommitTimestamps Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4939.27 KB 4939.27 KB 0 B
Total CSS 348.46 KB 348.46 KB 0 B

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected mentor:Aamod007 labels Aug 6, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Aug 6, 2026
@JhaSourav07
JhaSourav07 merged commit d79b537 into JhaSourav07:main Aug 6, 2026
20 of 21 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : handle NaN hours from invalid dates in processCommitTimestamps

3 participants