const endOfDate = (to) => {
  const temp = new Date();
  temp.setFullYear(to.year);
  if (to.month === null) {
    return endOfYear(temp);