1.1.14 • Published 3 years ago

date-preset v1.1.14

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago