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

tiny-date-format

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

by Vitor Luiz Cavalcanti

0.1.1 (see all)License:MITTypeScript:Built-In
npm i tiny-date-format
Readme

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.

TokenTypeRange
DDDay01 to 31
DDay1 to 31
MMMonth01 to 12
MMonth1 to 12
YYYYYear0000 to 9999
YYYear0 to 99
HHHour00 to 23
HHour0 to 23
mmMinute00 to 59
mMinute0 to 59
ssSecond00 to 59
sSecond0 to 59
[*]Escape 

License

Released under MIT license. You can see it here.

Downloads/wk

266

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
0.1.1
latest
4yrs ago
No alternatives found
No tutorials found
Add a tutorial