JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
lib
test
.gitignore
.jscsrc
.jshintrc
.travis.yml
ChangeLog
LICENSE
README.md
bower.json
package.json

README.md

Shortdate License NPM version Dependency Status Build Status Coverage Status

Get short date. For browser and node.

Install

npm i shortdate --save

How to use?

shortdate uses arguments:

  • date (optional)
  • options (optional):
    • sep - separator
    • order - "big", "middle", "little" (endian types);
var shortdate = require('shortdate');

shortdate();
// returns
'2015.01.08'

shortdate(new Date('9-9'));
// returns
'2001.09.09'

shortdate(new Date(), {
    sep: '/'
});
// returns
'2016/02/20'

shortdate(new Date(), {
    order: 'little'
});
// returns
'20.02.2016'

License

MIT