Skip to content

Fix ISO Date Format Validation in getAuthorLocalHour Function - #8754

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8679-iso-date-format-validation-getAuthorLocalHour
Aug 6, 2026
Merged

Fix ISO Date Format Validation in getAuthorLocalHour Function#8754
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8679-iso-date-format-validation-getAuthorLocalHour

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Description

Added ISO 8601 date format validation to getAuthorLocalHour in utils/dateHelpers.ts. Checks for the YYYY-MM-DDT prefix before substring extraction, falling back to new Date() parsing for non-ISO formats.

Pillar

  • Other (Bug fix, refactoring, docs)

Checklist

  • I have read the CONTRIBUTING.md file.
  • My commits follow the Conventional Commits format.

Note

Please assign this PR to the tmdeveloper007 account.

Closes #8746

@retenta-bot

retenta-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

This pull request enhances the getAuthorLocalHour function by validating ISO 8601 date formats, which is crucial for maintaining reliable date processing. This approach aligns with previous decisions made regarding date validation in the utils/dateHelpers.ts file, particularly the handling of invalid dates to prevent errors. Thank you for your contribution, and please let me know if you need any further assistance!

@retenta-bot retenta-bot Bot changed the title fix : validate ISO date format in getAuthorLocalHour function Fix ISO Date Format Validation in getAuthorLocalHour Function Aug 4, 2026
@tmdeveloper007
tmdeveloper007 force-pushed the fix/8679-iso-date-format-validation-getAuthorLocalHour branch from 75029c3 to 1dd284e Compare August 5, 2026 09:51
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@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.36 KB 4939.27 KB +0.09 KB (+0.00%)
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 a regex check for the \YYYY-MM-DDT\ ISO 8601 format in \utils/dateHelpers.ts\ before attempting substring extraction makes the \getAuthorLocalHour\ function significantly more robust. Falling back to the \Date\ object parser when the string doesn't match ensures we don't return garbage hours for unexpected formats. The tests added look great too. Approved!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Aug 6, 2026
@JhaSourav07
JhaSourav07 merged commit d79e0cc into JhaSourav07:main Aug 6, 2026
13 of 14 checks passed
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🎉 Congratulations @tmdeveloper007! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

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 : validate ISO date format in getAuthorLocalHour function

3 participants