I have a split string lines="Ram Hue, 134, 20.5.1994, 20.4.2004"
and I want to get the difference in dates between to dates 20.5.1994 and 20.5.1994, I tried in JavScript but i'ts not working. Also when trying to extract both dates using
lines[2] lines[3]
I'm getting wrong outputs
var date1 = new Date(lines[2])
var date2 = new Date(lines[3])
var diffDays = parseInt((date2-date1)/(1000*60*60*24),10)
console.log(diffDays)