I've been comparing moon positions with the Horizons calculator and is shows the 'toDateNumber' calculation is incorrect by 1 or 2 depending on rounding.
The correct code should just be:
function toDateNumber(date) { var diff = (date - new Date("2000-01-01T00:00")); return (1 + diff.valueOf()/86400e3); }
I've been comparing moon positions with the Horizons calculator and is shows the 'toDateNumber' calculation is incorrect by 1 or 2 depending on rounding.
The correct code should just be:
function toDateNumber(date) { var diff = (date - new Date("2000-01-01T00:00")); return (1 + diff.valueOf()/86400e3); }