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