1.0.0 • Published 4 years ago

mini-formater v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

mini-formater

a small and simple package for javascrip date formatting.


Install

using NPM:

npm install mini-formater

Usage

const format = require('mini-formater');

const date = new Date('12-3-2020');
const result = format(date, 'mmm dd yyyy');

console.log(result); // Dec 03 2020

Supported formats

FormatDescription
dthe date day as a single digit
ddthe date day as two digit
mthe date month as a single digit
mmthe date month two digit
mmmthe date month shortcut name (ex: 'Oct, Dec')
mmmmthe date month full name
yythe date year as two digits
yyyythe date full year

Supported separators

separators are used to separate date parts: | Separator | Example |-----------|---------------- |' ' space | '12 Oct 2019 |'-' dash | '12-Oct-2019 |'/' slash | '12/Oct/2019


License: MIT