-
Notifications
You must be signed in to change notification settings - Fork 49
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
ParseShort is not working as expected #24
Labels
Comments
@Dentrax apologies for the delay, is there a full code sample so that i can reproduce this? |
@hako I created a simple code snippet to reproduce: package main
import (
"time"
"github.com/hako/durafmt"
)
func main() {
d := (354 * time.Hour) + (22 * time.Minute) + (3 * time.Second)
println(durafmt.Parse(d).LimitFirstN(2).String())
// Expected: 2 weeks 18 hours
// Actual: 2 weeks 18 hours
println(durafmt.ParseShort(d).LimitFirstN(2).String())
// Expected: 2w 18h or 2 w 18 h
// Actual: 2 weeks 18 hours
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since this prints: 9 years 46 weeks
I expected the
ParseShort()
function to print this way: 9y 46wAm I missing something? If so, can we use custom formatting on these? (LONG, SHORT, etc.)
The text was updated successfully, but these errors were encountered: