next-time-ago v0.1.1
next-time-ago
A lightweight tiny time-ago component for your next React apps.
š Features
- No dependencies
- Compatible with both JavaScript and TypeScript
- Support for various languages
š§ Install
next-time-ago is available on npm. It can be installed with the following command:
npm install next-time-ago --save
next-time-ago is available on yarn as well. It can be installed with the following command:
yarn add next-time-ago --save
š” Usage
import { useTimeAgo } from 'next-time-ago';
const Home = () => {
const { TimeAgo } = useTimeAgo();
return (
<>
<TimeAgo date='September 1, 2022' locale='kh' />
<TimeAgo date='September 1, 2022' locale='JA' />
<TimeAgo date='September 1, 2022 9:00 pm' />
<TimeAgo date='September 1, 2022 20:00' />
</>
);
}
export default Home;
Props
List of Locale Codes
š Changelog
Latest version 0.1.1 (2022-10-12):
- Fix added dependencies
Details changes for each release are documented in the CHANGELOG.md.
ā Issues
If you think any of the next-time-ago
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-time-ago
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