Convert days to weeks and days

You didn’t say what you wanted returned in the third entry in the array but here’s the function that returns weeks in element zero and left over days in element one.

function getWeeks(d) {
a[0] = Math.floor(d/7);
a[1] = d%7;
return a;
}