Skip to content

Improve the ios1() and iso2() date parsers #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 22, 2025

Conversation

yuankunzhang
Copy link
Contributor

@yuankunzhang yuankunzhang commented Jul 20, 2025

  • Add TryFrom<(&str, u32, u32)> implementation for Date struct with validation.
  • Add comprehensive date validation for months, days, taking leap year into account.
  • Refactor iso1() and iso2() date parsers to use the new validation logic.

It now supports arbitrary length of year-string, month-string, and day-string, as long as they are valid values. For example: 000098-002-003 or 0000980203.

@yuankunzhang yuankunzhang force-pushed the improve-date-module branch 2 times, most recently from 1a003d2 to 416508e Compare July 20, 2025 12:24
- Add `TryFrom<(&str, u32, u32)>` implementation for `Date` struct
  with validation.
- Add comprehensive date validation for months, days, taking leap
  year into account.
- Refactor `iso1()` and `iso2()` date parsers to use the new
  validation logic.
@yuankunzhang yuankunzhang force-pushed the improve-date-module branch from 416508e to 7478659 Compare July 20, 2025 12:28
@yuankunzhang yuankunzhang changed the title Improve the date module Improve the ios1() and iso2() date parsers Jul 20, 2025
Co-authored-by: Daniel Hofstetter <[email protected]>
Co-authored-by: Daniel Hofstetter <[email protected]>
@cakebaker cakebaker merged commit 5ba4b18 into uutils:main Jul 22, 2025
17 checks passed
@cakebaker
Copy link
Collaborator

Thanks!

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (5d869b5) to head (4603a1c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #183   +/-   ##
===========================
===========================

☔ 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.

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.

2 participants