import { Moment } from "moment";
import moment from "moment-timezone";

export const isDisabledDate = (date: Moment) => {
  const timezone = date.tz();

  const today = timezone ? moment.tz(timezone) : moment.utc();
  const target = timezone ? date.tz(timezone) : date.utc();

  const midnightToday = today.startOf("day");
  const midnightTarget = target.startOf("day");

  return date && midnightToday.isAfter(midnightTarget);
};
