1.0.2 • Published 3 years ago

year-month-date v1.0.2

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

year-month-date

YYYY.MM.DD or YYYY-MM-DD with constant width, eg 2021-02-03

usage

npm i year-month-date

or

npm i -D year-month-date

Called with no arguments, the date will be the current date.

const ymd = require('year-month-date')
console.log(ymd());  // 2021-01-02 (if the date was 2nd of Jan 2021)

Alternatively pass a date object and/or a custom separator.

const ymd = require('year-month-date')
const inTenDaysTime = new Date(+new Date() + 8.64e+8);
console.log(ymd({
	date: inTenDaysTime,
	separator: "/"
}));  // 2021/01/12 (if the date was 2nd of Jan 2021)
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago