Skip to content

Commit

Permalink
Updating guides on distance_of_time_in_words with Time Span overload. F…
Browse files Browse the repository at this point in the history
…ixes #1292
  • Loading branch information
jwoertink committed Jul 21, 2024
1 parent 30c7eb6 commit bac9be4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/actions/guides/frontend/rendering_html.cr
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,14 @@ class Guides::Frontend::RenderingHtml < GuideAction
# => "almost 42 years"
```
You can also pass in a `Time::Span` object to get a String representation.
```crystal
distance_of_time_in_words(5.seconds) # => "5 seconds"
distance_of_time_in_words(25.minutes) # => "25 minutes"
distance_of_time_in_words(2.days) # => "2 days"
```
### Time ago in words
Similar to `distance_of_time_in_words`.
Expand Down

0 comments on commit bac9be4

Please sign in to comment.