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

Parse negative special durations as negative durations #143

Open
gabizou opened this issue Jan 21, 2025 · 2 comments · May be fixed by #144
Open

Parse negative special durations as negative durations #143

gabizou opened this issue Jan 21, 2025 · 2 comments · May be fixed by #144

Comments

@gabizou
Copy link

gabizou commented Jan 21, 2025

Simply put, if you parse strfmt.ParseDuration("-1h"), you will correctly get minus 1 hour. However, when using the "enhanced" durations like d/w, you will not get a negative duration, but a positive one. So strfmt.ParseDuration("-1d") will result in a positive day duration.

@ccoVeille
Copy link

I can take a look

@ccoVeille ccoVeille linked a pull request Jan 21, 2025 that will close this issue
@ccoVeille
Copy link

I provided a fix

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 a pull request may close this issue.

2 participants