open-consul/ui/packages/consul-ui/app/helpers/duration-from.mdx
John Cowen a389eab7b0
ui: Adds human formatting to nanosecond based session durations (#10062)
* ui: Adds human formatting to nanosecond based session durations
2021-04-28 12:12:56 +01:00

14 lines
376 B
Plaintext

# duration-from
`{{duration-from nanoseconds}}` is used to format a number in nanoseconds to a
short golang-like human format, for example:
```hbs preview-template
<p>{{duration-from 15000000000}}</p>
<p>{{duration-from 15000010001}}</p>
```
**Note:** The helper only accepts a javascript number primitive currently
Also see the `temporal` service for the implementation.