JavaScript component to return the year, month, and day. Call toString() and returns YYYY-MM-dd from Date object.
It's really useful to get a date in the format of YYYY-MM-dd.
npm i --save ymd
year, month, day, ymd, and toString().var ymd = require('ymd')
console.log(ymd(new Date('2013-03-05 4:43 PM').ymd))
// => '2013-03-05'
console.log(ymd().ymd)
// => date in 'YYYY-MM-dd' format
(MIT License)
Copyright (c) JP Richardson