Skip to content
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

Add support for only hours in time format with tests #604

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Add support for only hours in time format with tests #604

merged 1 commit into from
Jul 28, 2023

Conversation

GunnarMorrigan
Copy link
Contributor

Per issue #603 add support for just hours in the time format. This allows leaving out the minutes when parsing a time or datetime object.

If it is necessary to add more tests for specific cases or if the enhancement needs to be implemented through a different method than this simple change, please let me know.

The time macro was not adjusted as I think it does not makes sense to make time!(12) convert to 12:00 instead of 00:12. The user can simply write out the desired time.

@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #604 (1d1c4f8) into main (bd678cb) will decrease coverage by 0.1%.
Report is 1 commits behind head on main.
The diff coverage is 97.1%.

@@           Coverage Diff           @@
##            main    #604     +/-   ##
=======================================
- Coverage   95.8%   95.7%   -0.1%     
=======================================
  Files         79      79             
  Lines       8932    8973     +41     
=======================================
+ Hits        8557    8589     +32     
- Misses       375     384      +9     
Files Changed Coverage Δ
time/src/parsing/parsed.rs 94.3% <97.1%> (-1.4%) ⬇️
time/src/parsing/parsable.rs 98.6% <100.0%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@GunnarMorrigan
Copy link
Contributor Author

I will need to check and possibly update the documentation. Will add this

@jhpratt
Copy link
Member

jhpratt commented Jul 28, 2023

Diff looks good. There's one thing I thought of while looking at it, but I don't want to put it on you. Merging as-is 🙂

@jhpratt jhpratt merged commit bbea8cd into time-rs:main Jul 28, 2023
@jhpratt jhpratt added A-parsing Area: parsing C-enhancement Category: an enhancement with existing code labels Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: parsing C-enhancement Category: an enhancement with existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants