https://github.com/themojilla/rago
A utility helper to calculate "time ago" or "from now " in a readable format using Intl API
https://github.com/themojilla/rago
dayjs fromnow intl intl-api javascript momentjs relative-time
Last synced: about 1 year ago
JSON representation
A utility helper to calculate "time ago" or "from now " in a readable format using Intl API
- Host: GitHub
- URL: https://github.com/themojilla/rago
- Owner: themojilla
- Created: 2020-04-21T10:35:57.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-06T14:31:02.000Z (over 2 years ago)
- Last Synced: 2025-04-23T01:55:01.606Z (about 1 year ago)
- Topics: dayjs, fromnow, intl, intl-api, javascript, momentjs, relative-time
- Language: TypeScript
- Homepage:
- Size: 263 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rago
A utility helper to calculate "time ago" or "from now " in a readable format using Intl API. [](https://badge.fury.io/js/rago)
> Warning: the `rago` tend to use Intl API internally. It is made for modern browsers, but if you want to keep things also working for older ones, make sure to polyfill the Intl API
## Installation
```bash
yarn add rago
```
## Usage
```javascript
import { fromNow } from 'rago';
fromNow('2019-04-21T11:34:41.773Z'); // 2 years ago
fromNow('2020-04-21T12:24:01Z', 'fa'); // سال گذشته
```