Skip to content
Primer/ViewComponents
What's new
Design
Interface guidelinesOcticonsPresentationsCommand lineMobileDesktop
Build
CSSReactViewComponents
ContributeAbout
Getting started
ContributingSystem argumentsLintingMigrationComponent status
Components
AutoCompleteAutoCompleteItemAvatarAvatarStackBlankslateBorderBoxBoxBreadcrumbsButtonButtonGroupButtonMarketingClipboardCopyCloseButtonCounterDetailsDropdownDropdownMenuFlashFlexFlexItemHeadingHiddenTextExpanderIconButtonImageImageCropLabelLayoutLinkLocalTimeMarkdownMenuOcticonOcticonSymbolsPopoverProgressBarSpinnerStateSubheadTabContainerTabNavTabPanelsTextTimeAgoTimelineItemTruncateUnderlineNavUnderlinePanels
Architecture decisions
Developing and publishing client-side behaviours251. Use Catalyst for client-side behaviours
GitHub
On this page
  • Arguments
  • Examples

TimeAgo

Beta
View sourceView storybook
On this page
  • Arguments
  • Examples
This component requires JavaScript to function. Please refer to the Installation section to set it up.

Use TimeAgo to display a time relative to how long ago it was. This component requires JavaScript.

Arguments

NameTypeDefaultDescription
timeTimeN/AThe time to be formatted
microBooleanfalseIf true then the text will be formatted in "micro" mode, using as few characters as possible
system_argumentsHashN/ASystem arguments

Examples

Default

Nov 28, 1989
<%= render(Primer::TimeAgoComponent.new(time: Time.at(628232400))) %>
Edit this page on GitHub