This package has been deprecated

Author message:

"tiny-date-format" is deprecated. It was renamed and moved to "@bitty" scoped packages. Now it should be installed as "@bitty/format-date".

tiny-date-format
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

tiny-date-format

Build Status

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.

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.

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  

License

Released under MIT license. You can see it here.

Readme

Keywords

none

Package Sidebar

Install

npm i tiny-date-format

Weekly Downloads

7

Version

0.1.1

License

MIT

Unpacked Size

12 kB

Total Files

13

Last publish

Collaborators

  • vitorluizc