For the following JavaScript, I was expecting output to be 1 but it is not, any explanation?
var startDate = moment('2018-01-01');
var endDate = moment('2018-12-31');
moment.duration(endDate.diff(startDate)).asYears()
0.9965981505438167
What start and end dates would give 1 full year?