I am using this in reactjs and getting an error i.e date1.diff is not a function. I have also tried putting parseInt(date1) before using diff function.
const