1.0.4 • Published 6 years ago
@dastrangeboi/date-formatter v1.0.4
Date Formatter
Use at your own risk as this project is still in development
A simple library that formats the JavaScript date constructor -I'm not sure if I'll add on to this and make it better
How to use
dateformatter(date, type);
where date
is the NodeJS Date constructor and
where type
is a type of format
types ( as a string )
- shortword ( Mon Sept 2 2019 )
- longword ( Monday September 2 2019 )
- time ( 3:09:27 )
- number ( 9/2/2019 3:10:20 )
Usage
const dateformatter = require('@dastrangeboi/date-formatter');
const date = new Date();
console.log(dateformatter(date, 'shortdate')); // returns 'Mon Sept 2 2019'