Skip to content

fix(isISO8601): validate midnight second separators - #2872

Open
wangxpych wants to merge 1 commit into
validatorjs:masterfrom
wangxpych:fix/isiso8601-midnight-separators
Open

fix(isISO8601): validate midnight second separators#2872
wangxpych wants to merge 1 commit into
validatorjs:masterfrom
wangxpych:fix/isiso8601-midnight-separators

Conversation

@wangxpych

Copy link
Copy Markdown

Fixes #2858.

The 24:?00 alternative bypassed the minute-separator capture that the seconds backreference uses. This made T24:00:00 fail while allowing nonzero seconds and mixed basic/extended separators after hour 24.

This change moves hour 24 through the same minute-separator capture as other hours, while lookaheads keep its minute and second fields at zero. Regression coverage includes extended and basic midnight forms, nonzero seconds, and separator mismatches under the default, strict, and strict-separator paths.

Validation:

  • npm test — 323 passing; all builds and ESLint included

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (not applicable; the public API is unchanged)
  • Tests written
  • References provided (the existing T24:00 contract and linked issue reproduction cover the behavior)

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a79ff98) to head (43c257e).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2872   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isISO8601 rejects T24:00:00 and accepts mixed separators

1 participant