-1

How to Calculate and populate no. of days between two input dates in an Html table row by using javascript? I have an understanding of Html, javascript, jQuery

I am a new programmer and I stuck on this step please help me out Thanks

Saad Jafri
  • 21
  • 4

1 Answers1

0

use

function datesDiff(d1, d2){return (new Date(d1)-new Date(d2))/(1000*60*60*24)}

example usage:

datesDiff('03/12/2019', '02/12/2019'); //output 28
Yosef Tukachinsky
  • 5,570
  • 1
  • 13
  • 29