MCPcopy
hub / github.com/logamee/lin-ui / compareDay

Function compareDay

src/calendar/util.js:45–64  ·  view source on GitHub ↗
(date1, date2)

Source from the content-addressed store, hash-verified

43}
44
45export function compareDay(date1, date2) {
46 if (!(date1 instanceof Date)) {
47 date1 = getDate(date1);
48 }
49
50 if (!(date2 instanceof Date)) {
51 date2 = getDate(date2);
52 }
53
54 const compareMonthResult = compareMonth(date1, date2);
55
56 if (compareMonthResult === 0) {
57 const _date1 = date1.getDate();
58 const _date2 = date2.getDate();
59
60 return _date1 === _date2 ? 0 : _date1 > _date2 ? 1 : -1;
61 }
62
63 return compareMonthResult;
64}
65
66export function calcDateNum(date) {
67 const day1 = new Date(date[0]).getTime();

Callers 5

clickDayFunction · 0.90
initCurrentDateFunction · 0.90
isDateInCurrentFunction · 0.90
getRangeDayTypeFunction · 0.90
getDayTypeFunction · 0.90

Calls 2

getDateFunction · 0.85
compareMonthFunction · 0.85

Tested by

no test coverage detected