// src/components/DataManagerTable/date_utils.ts
var SECOND = 1e3;
var MINUTE = SECOND * 60;
var HOUR = MINUTE * 60;
var DAY = HOUR * 24;
var TimeGranularity = /* @__PURE__ */ ((TimeGranularity2) => {
  TimeGranularity2["Minutes"] = "minutes";
  TimeGranularity2["Hours"] = "hours";
  TimeGranularity2["Days"] = "days";
  return TimeGranularity2;
})(TimeGranularity || {});
var GRANULARITY_TO_MILLIS = {
  ["minutes" /* Minutes */]: MINUTE,
  ["hours" /* Hours */]: HOUR,
  ["days" /* Days */]: DAY
};
var MAX_DATE = /* @__PURE__ */ new Date("3000-01-01");
var MIN_DATE = /* @__PURE__ */ new Date("1970-01-01");
var subtractTime = (date, value, granularity) => {
  return new Date(date.getTime() - value * GRANULARITY_TO_MILLIS[granularity]);
};
var startOfDay = (date) => {
  const start = new Date(date);
  start.setHours(0, 0, 0, 0);
  return start;
};
var endOfDay = (date) => {
  const end = new Date(date);
  end.setHours(23, 59, 59, 999);
  return end;
};
var DateRangeOperation = /* @__PURE__ */ ((DateRangeOperation2) => {
  DateRangeOperation2["IsInTheLast"] = "is in the last";
  DateRangeOperation2["IsEqualTo"] = "is equal to";
  DateRangeOperation2["IsBetween"] = "is between";
  DateRangeOperation2["IsAfter"] = "is after";
  DateRangeOperation2["IsBefore"] = "is before";
  return DateRangeOperation2;
})(DateRangeOperation || {});

export {
  TimeGranularity,
  MAX_DATE,
  MIN_DATE,
  subtractTime,
  startOfDay,
  endOfDay,
  DateRangeOperation
};
