Skip to content

Commit

Permalink
doc: add example using WithLocale to README
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdevivo committed Feb 2, 2022
1 parent 215c543 commit fb3b574
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ str5 := timediff.TimeDiff(time.Now().Add(10 * time.Hour))
fmt.Println(str5) // in 10 hours
```

```golang
str := timediff.TimeDiff(time.Now().Add(-3 * time.Minute), timediff.WithLocale("pt-BR"))
fmt.Println(str) // em 3 minutos
```

Here are examples of durations and their corresponding string outputs (taken from test output), using default options:

```
Expand Down

0 comments on commit fb3b574

Please sign in to comment.