MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / DateDayDifference

Function DateDayDifference

Conversions/DateDayDifference.js:24–32  ·  view source on GitHub ↗
(date1, date2)

Source from the content-addressed store, hash-verified

22}
23
24const DateDayDifference = (date1, date2) => {
25 const firstDate = parseDate(date1)
26 const secondDate = parseDate(date2)
27
28 return Math.abs(
29 DateToDay(secondDate.day, secondDate.month, secondDate.year) -
30 DateToDay(firstDate.day, firstDate.month, firstDate.year)
31 )
32}
33
34// Example : DateDayDifference('17/08/2002', '10/10/2020') => 6630
35

Callers 1

Calls 2

parseDateFunction · 0.90
DateToDayFunction · 0.70

Tested by

no test coverage detected