1.1.14 • Published 2 years ago
date-preset v1.1.14
This is for me
const nowTime = Date.now();
const endTime = end_date.getTime();
const { gap } = getDateGap(endTime, nowTime);
// (dateGap, hourGap, minuteGap, secondGap) > 0
if (gap === 'past') {
end_date.setDate(end_date.getDate() + 1);
end_date = dateTimeRest(end_date);
} else if (gap === 'today') {
end_date = now;
} else {
end_date = dateTimeRest(end_date);
}
getDateGap(origin, compare, option)
:
- origin, compare : origin | compare Date (you can use type timeStamp(string), Date)
option is optional (you can use divide type for
Math.round
=> round)you can use
dateGap
,hourGap
,minuteGap
,secondGap
.
isSameDate(origin, compare, checkTime)
- in my lib you cans use date type string | Date
- return data type is only Boolean!
true
will be same date,false
will be different.
1.1.14
2 years ago
1.1.13
2 years ago
1.1.12
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago