# relative-date

> Javascript module for outputting relative dates.

Latest version **1.1.3** (published 2016-03-23) · 0 weekly downloads

## Install

```sh
npm install relative-date
pnpm add relative-date
yarn add relative-date
bun add relative-date
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2016-03-23 |
| First published | 2011-03-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Azer Koculu |
| Maintainers | nj48 |
| Keywords | pretty, date, timestamp, format, human-readable, relative |

## Links

- npm: https://www.npmjs.com/package/relative-date
- Repository: https://github.com/n-johnson/relative-date
- Issues: https://github.com/n-johnson/relative-date/issues
- npm.io page: https://npm.io/package/relative-date

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2016-03-23
- 2.0.0 — 2016-03-22
- 1.1.2 — 2015-02-26
- 1.1.1 — 2011-10-15
- 1.1.0 — 2011-07-21
- 1.0.0 — 2011-03-09

## README

Javascript module for outputting relative dates. Tested platforms: Node, Firefox 3.6, Chromium 8.0

Install
=======
npm install relative-date

Usage
=====
On browsers:

```js
<script src="relative-date.js"></script>
<script>
  assert( relativeDate(new Date()), 'just now' );
  assert( relativeDate(1299627946000), '12 minutes ago');
  assert( relativeDate(0), '41 years ago');
</script>
```

On a CommonJS compliant environment:

```js
> var relativeDate = require('relative-date');
> relativeDate(new Date())
'just now'
> relativeDate(1299627946000)
'12 minutes ago'
> relativeDate(0)
'41 years ago'
```
    
Testing
=======
node test/node.js || test/browser.html

---
_Source: https://npm.io/package/relative-date · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
