@team-devmonster/date
v1.0.54
Published
This is a simple date module.
Downloads
9
Readme
@team-devmonster/date
This is simple date module.
author: devmonster
We are always looking for investment or assistance. hompage: https://devmonster.co.kr email: [email protected]
items
- [o] [today]
- [o] [toMonth]
- [o] [toString]
- [o] [compareTime]
Getting started
$ npm install @team-devmonster/date@latest
Examples
Easy. Too Easy.
today();
// return today as YYYY-MM-DD
today({ year: -1 });
// return last year as YYYY-MM-DD
today({ month: -1 });
// return last month as YYYY-MM-DD
today({ date: -1 });
// return last date as YYYY-MM-DD
today({ type: 'YYYY-MM-DD hh:mm:ss' });
// return last date as YYYY-MM-DD hh:mm:ss
toMonth();
// return this Month as YYYY-MM
toMonth({ year: -1 });
// return last year as YYYY-MM
toMonth({ month: -1 });
// return last month as YYYY-MM
toMonth({ date: -1 });
// return last date as YYYY-MM
toString(date:Date);
// return date as YYYY-MM-DD
compareTime({ date: '2022-12-31' });
compareTime({ date: new Date() });
// return compared time with now.
// ex) 12월 31일, 1일전, 어제, 1시간 전, 1분 전, 방금전
compareTime({ date: '2022-12-31', date2: '2023-01-01' });
// return compared time date & date2.
// ex) 12월 31일, 1일전, 어제, 1시간 전, 1분 전, 방금전
compareTime({ date: '2022-12-31', date2: '2023-01-01', type: 'time' });
// return compared time. as milliseconds.
// ex) -3284343434, 3483489
devmonsters
modules
for javascript
for react
for react-native