Home » Php » javascript – Populate no.of days in html table

javascript – Populate no.of days in html table

Posted by: admin February 25, 2020 Leave a comment

Questions:

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

How to&Answers:

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