Ariadne

TimeAgoComponent

import Example from ‘../../src/@primer/gatsby-theme-doctocat/components/example’ import RequiresJSFlash from ‘../../src/@primer/gatsby-theme-doctocat/components/requires-js-flash’

Displays a time ariadne-relative to how long ago it was. This component requires JavaScript.

Arguments

Name Type Default Description
tag Symbol, String :time-ago The rendered tag name.
time Time N/A The time to be formatted
micro Boolean false If true then the text will be formatted in “micro” mode, using as few characters as possible
classes String "" <%= link_to_classes_docs %>
attributes Hash {} Classes and attributes

Examples

Default


<%= render(Ariadne::TimeAgoComponent.new(time: Time.now)) %>

Have questions?

Still have questions? Talk to support.

Previous
Text