Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

next-timeago

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-timeago

React timeago component for your next React apps.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
579
-3.18%
Maintainers
1
Weekly downloads
 
Created
Source

next-timeago

React timeago component for your next React apps.

NPM JavaScript Style Guide

🎁 Features

  • No dependencies
  • Compatible with both JavaScript and TypeScript
  • Support for various languages

🔧 Install

next-timeago is available on npm. It can be installed with the following command:

npm install next-timeago --save

next-timeago is available on yarn as well. It can be installed with the following command:

yarn add next-timeago --save

💡 Usage

import { useTimeAgo } from 'next-timeago';

const Home = () => {
  const { TimeAgo } = useTimeAgo();

  return (
    <>
      <TimeAgo date='July 1, 2023' locale='kh' />

      <TimeAgo date='July 1, 2023' locale='JA' />

      <TimeAgo date='July 1, 2023 9:00 pm' />

      <TimeAgo date='July 1, 2023 20:00' />
    </>
  );
}

export default Home;

Props

PropTypeDefaultRequireDescription
datestring | number | Date✔️A date in the past.
localestringenSupport for various languages.
livebooleantrueLive by default and will auto update it's value.
elementstring | React.ElementTypetimeHTML tag that is used to wrap the live updating string.

List of Locale Codes

Language NameCode
Afrikaansaf
Arabicar
Azerbaijaniaz
Azerbaijani shortenedaz-short
Belarusianbe
Bulgarianbg
Bosnianbs
Catalanca
Czechcs
Welshcy
Danishda
Germande
German shortenedde-short
Divehi, Dhivehi, Maldiviandv
Greekel
Englishen
English shorteneden-short
Spanishes
Spanish shortenedes-short
Estonianet
Basqueeu
Persianfa
Persian shortenedfa-short
Finnishfi
Frenchfr
French shortenedfr-short
Galiciangl
Hebrewhe
Hindihi
Croatianhr
Hungarianhu
Armenianhy
Indonesianid
Icelandicis
Italianit
Italian shortenedit-short
Japaneseja
Javanessejv
Georgianjv
Georgian shortenedka-short
Khmerkh
Koreanko
Russianky
Lithuanianlt
Latvianlv
Macedonianmk
Dutchnl
Norwegianno
Catalanoc
Polishpl
Portuguesept
Brazilian Portuguesept-br
Portuguese Brasil shortenedpt-br-short
Portuguese shortenedpt-short
Romanianro
Serbianrs
Russianru
Kinyarwandarw
Sinhalesesi
Slovaksk
Slovenian with support for dualsl
Somaliso
Serbiansr
Swedishsv
Tamilta
Thaith
Turkishtr
Turkish shortenedtr-short
Ukrainianuk
Uzbekuz
Vietnamesevi
Simplified Chinesezh-CN
Traditional Chinese, zh-twzh-TW

📜 Changelog

Latest version 0.2.0 (2023-08-23):

  • Upgrade dependencies

Details changes for each release are documented in the CHANGELOG.md.

❗ Issues

If you think any of the next-timeago can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

💪 Contribution

We'd love to have your helping hand on contributions to next-timeago by forking and sending a pull request!

Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)

How to contribute:

  • Open pull request with improvements
  • Discuss ideas in issues
  • Spread the word
  • Reach out with any feedback

🏆 Contributors

Bunlong
Bunlong

⚖️ License

The MIT License License: MIT

Keywords

next-timeago

FAQs

Package last updated on 23 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts