# tiny-date-format

> A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.

Latest version **0.1.1** (published 2018-06-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tiny-date-format
pnpm add tiny-date-format
yarn add tiny-date-format
bun add tiny-date-format
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-06-17 |
| First published | 2018-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Vitor Luiz Cavalcanti |
| Maintainers | vitorluizc |

## Links

- npm: https://www.npmjs.com/package/tiny-date-format
- Repository: https://github.com/VitorLuizC/tiny-date-format
- Issues: https://github.com/VitorLuizC/tiny-date-format/issues
- npm.io page: https://npm.io/package/tiny-date-format

## Recent versions

- 0.1.1 (latest) — 2018-06-17
- 0.1.0 — 2018-06-17

## README

# tiny-date-format

[![Build Status][2]][1]

`tiny-date-format` is a small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.

## Install

`tiny-date-format` is published under NPM registry.

```sh
npm install --save tiny-date-format

# Use the command below if you're using Yarn.
yarn add tiny-date-format
```

## Usage

`tiny-date-format` exports a function to format JavaScript `Date` object using [moment tokens][3].

```js
import format from 'tiny-date-format';

format(new Date(), 'DD/MM/YYYY HH [hours] and mm [minutes].');
// I'm escaping "hours" and "minutes" using same syntax as moment.
```

## Supported tokens

Right now this lib supports the tokens below.

| Token | Type   | Range        |
| ----- | ------ | ------------ |
| DD    | Day    | 01 to 31     |
| D     | Day    | 1 to 31      |
| MM    | Month  | 01 to 12     |
| M     | Month  | 1 to 12      |
| YYYY  | Year   | 0000 to 9999 |
| YY    | Year   | 0 to 99      |
| HH    | Hour   | 00 to 23     |
| H     | Hour   | 0 to 23      |
| mm    | Minute | 00 to 59     |
| m     | Minute | 0 to 59      |
| ss    | Second | 00 to 59     |
| s     | Second | 0 to 59      |
| [*]   | Escape | &nbsp;       |

## License

Released under MIT license. You can see it [here][0].

<!-- Links -->

[0]: ./LICENSE
[1]: https://travis-ci.org/VitorLuizC/tiny-date-format
[2]: https://travis-ci.org/VitorLuizC/tiny-date-format.svg?branch=master
[3]: http://momentjs.com/docs/#/displaying/format/

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