import "../../chunks/chunk.QU3DSPNU.js";
import { html } from "lit";
import {
  addDays,
  eachDayOfInterval,
  eachWeekOfInterval,
  endOfMonth,
  startOfMonth
} from "date-fns";
function renderMonthGridView(date, template) {
  const monthStart = startOfMonth(date);
  const monthEnd = endOfMonth(date);
  const weeks = eachWeekOfInterval(
    { start: monthStart, end: monthEnd },
    { weekStartsOn: 1 }
  );
  while (weeks.length < 6) {
    weeks.push(addDays(weeks[weeks.length - 1], 7));
  }
  return html`${template(
    weeks.map((weekStartDay) => ({
      days: eachDayOfInterval({
        start: weekStartDay,
        end: addDays(weekStartDay, 6)
      })
    }))
  )}`;
}
export {
  renderMonthGridView
};
