@vuecs/timeago
v2.1.4
Published
A package containing a timeago component.
Downloads
1,814
Readme
@vuecs/timeago
<VCTimeago> — live relative timestamps for Vue 3 ("3 minutes ago", "in 2 days"), part of vuecs. Locale-aware through vuecs's central locale config, auto-updating as time passes.
✨ What's inside
- 🕒 Flexible input —
:datetimeacceptsDate, epoch number, or ISO string. - 🔄 Auto-update — re-renders as the relative time changes; disable with
:auto-update="false". - 🌍 Locale-aware — reads the app-wide locale via
useLocale()from@vuecs/core(set it throughconfig: { locale },@vuecs/locale, or your i18n library); per-instance:localeprop wins. Registerdate-fnslocales viaprovideLocales. - 🧪 Custom converter — swap the formatting logic entirely via the
:converter/:converter-optionsprops.
📦 Installation
npm install @vuecs/timeago⚡ Usage
<VCTimeago :datetime="post.createdAt" />
<VCTimeago :datetime="Date.now() - 60_000" locale="de-DE" />📚 Documentation
Full reference + locale setup: vuecs.dev/components/timeago
License
Made with 💚
Published under Apache 2.0 License.
