date-with-slashes

1.0.2 • Public • Published

date-with-slashes

Utility function for converting javascript date object to string in the format 'MM/DD/YY'

import dateWithSlashes from 'date-with-slashes';
 
const todaySlashified = dateWithSlashes(new Date());
 
console.log(todaySlashified); // it's May 2, 2016 so this will log '5/2/16'
 
// with four digit year
const todaySlashifiedFour = dateWithSlashes(new Date(), true);
 
console.log(todaySlashifiedFour); // it's May 2, 2016 so this will log '5/2/2016'

NPM

Readme

Keywords

none

Package Sidebar

Install

npm i date-with-slashes

Weekly Downloads

3

Version

1.0.2

License

MIT

Last publish

Collaborators

  • sir-rodge-podge