'use strict';

var dayjs = require('dayjs');

const getDateShortcuts = (type) => {
  const daterangeShortcutValue = [
    {
      text: "\u672C\u5468",
      value: () => {
        const start = dayjs().startOf("week").toDate();
        const end = dayjs().endOf("week").toDate();
        return [start, end];
      }
    },
    {
      text: "\u672C\u6708",
      value: () => {
        const start = dayjs().startOf("month").toDate();
        const end = dayjs().endOf("month").toDate();
        return [start, end];
      }
    },
    {
      text: "\u4E0A\u6708",
      value: () => {
        const now = dayjs();
        const startOfThisMonth = now.startOf("month");
        const endOfLastMonth = startOfThisMonth.subtract(1, "day");
        const startOfLastMonth = endOfLastMonth.startOf("month");
        return [startOfLastMonth.toDate(), endOfLastMonth.toDate()];
      }
    },
    {
      text: "\u8FD13\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 2);
        return [start, end];
      }
    },
    {
      text: "\u8FD17\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 6);
        return [start, end];
      }
    },
    {
      text: "\u8FD115\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 14);
        return [start, end];
      }
    },
    {
      text: "\u8FD130\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 29);
        return [start, end];
      }
    },
    {
      text: "\u8FD160\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 59);
        return [start, end];
      }
    },
    {
      text: "\u8FD190\u5929",
      value: () => {
        const end = /* @__PURE__ */ new Date();
        const start = /* @__PURE__ */ new Date();
        start.setTime(start.getTime() - 3600 * 1e3 * 24 * 89);
        return [start, end];
      }
    }
  ];
  const shortcuts = [
    {
      type: "date",
      values: [
        {
          text: "\u4ECA\u5929",
          value: () => /* @__PURE__ */ new Date()
        },
        {
          text: "\u6628\u5929",
          value: () => {
            const date = /* @__PURE__ */ new Date();
            date.setTime(date.getTime() - 3600 * 1e3 * 24);
            return date;
          }
        },
        {
          text: "\u4E00\u5468\u524D",
          value: () => {
            const date = /* @__PURE__ */ new Date();
            date.setTime(date.getTime() - 3600 * 1e3 * 24 * 7);
            return date;
          }
        }
      ]
    },
    {
      type: "daterange",
      values: daterangeShortcutValue
    },
    {
      type: "datetimerange",
      values: daterangeShortcutValue
    }
  ];
  return shortcuts.find((it) => it.type === type)?.values ?? [];
};

exports.getDateShortcuts = getDateShortcuts;
//# sourceMappingURL=dateShortcuts.js.map
