We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since this prints: 9 years 46 weeks
durafmt.Parse(t).LimitFirstN(2).String()
I expected the ParseShort() function to print this way: 9y 46w
ParseShort()
durafmt.ParseShort(t).LimitFirstN(2).String()
Am 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:
@Dentrax apologies for the delay, is there a full code sample so that i can reproduce this?
Sorry, something went wrong.
@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 }
No branches or pull requests
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: