Skip to content

feat(isMobilePhone): add support for Croatia (hr-HR) locale#2672

Open
abhu85 wants to merge 1 commit intovalidatorjs:masterfrom
abhu85:feat/croatia-phone-hr-HR
Open

feat(isMobilePhone): add support for Croatia (hr-HR) locale#2672
abhu85 wants to merge 1 commit intovalidatorjs:masterfrom
abhu85:feat/croatia-phone-hr-HR

Conversation

@abhu85
Copy link

@abhu85 abhu85 commented Mar 2, 2026

Summary

Add mobile phone validation support for Croatia (hr-HR locale).

Addresses #1761 (Mobile Phone validations - For The First Time Contributors)

Changes

  • Add hr-HR regex pattern to isMobilePhone.js supporting:
    • Mobile prefixes: 91, 92, 95, 97, 98, 99
    • Format: +385 9X XXXXXXX or 09X XXXXXXX (10 digits local, 12 international)
  • Add comprehensive test cases (13 valid + 8 invalid numbers)
  • Update README.md to include hr-HR in locale list

Croatian Mobile Operators

Prefix Operator
91 T-Mobile (Hrvatski Telekom)
92, 95 A1 Hrvatska
97, 98, 99 Various (Tele2, etc.)

Test Plan

  • All 317 existing tests pass
  • 100% code coverage maintained
  • Linting passes
  • New locale tested with valid and invalid number formats

References

  • ITU-T E.164 numbering plan for Croatia
  • Croatian regulatory authority (HAKOM) numbering guidelines

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b1aea75) to head (363af92).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2672   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2595      2595           
  Branches       659       659           
=========================================
  Hits          2595      2595           

☔ View full report in Codecov by Sentry.
📢 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.

Add mobile phone validation for Croatia with support for:
- Mobile prefixes: 91, 92, 95, 97, 98, 99
- Format: +385 9X XXXXXXX or 09X XXXXXXX (10 digits local, 12 international)

Croatian mobile operators:
- 91: T-Mobile (Hrvatski Telekom)
- 92, 95: A1 Hrvatska
- 97, 98, 99: Various operators (Tele2, etc.)

References:
- https://en.wikipedia.org/wiki/Telephone_numbers_in_Croatia
- ITU-T E.164 numbering plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abhu85 abhu85 force-pushed the feat/croatia-phone-hr-HR branch from 35c1db9 to 363af92 Compare March 7, 2026 16:26
@rubiin rubiin requested a review from WikiRik March 7, 2026 16:32
@abhu85
Copy link
Author

abhu85 commented Mar 9, 2026

Hi maintainers 👋

Friendly ping on this PR adding Croatia (hr-HR) locale support for isMobilePhone. All tests passing and follows the existing locale patterns.

I also have a few other locale PRs open (#2670, #2671, #2667) if you'd like to batch review them together. Thanks!

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.

1 participant