import t from "./index-moment.js";
const a = (e) => {
  const m = t.utc(e, "YYYY-MM-DD HH:mm:ss").local();
  return {
    // Start of the day in local time, in milliseconds
    date: m.clone().startOf("day").unix().valueOf(),
    // Time in "HH:mm" format in local time
    time: m.format("HH:mm"),
    // Date and time in "YYYY-MM-DD HH:mm" format in local time
    dateTime: m.format("YYYY-MM-DD HH:mm")
  };
}, i = (e) => t(e, "YYYY-MM-DD HH:mm:ss").isAfter(t()), s = (e, m = "00:00") => {
  const n = t.utc(String(e).length === 10 ? e * 1e3 : e), o = t.utc(m, "HH:mm");
  return n.clone().local().hour(o.hour()).minute(o.minute()).second(0).format("YYYY-MM-DD HH:mm:ss");
}, u = (e, m = "00:00") => {
  const n = t(String(e).length === 10 ? e * 1e3 : e), o = t(m, "HH:mm");
  return n.clone().local().hour(o.hour()).minute(o.minute()).second(0).utc().format("YYYY-MM-DD HH:mm:ss");
}, D = (e, m = "00:00") => {
  const n = t(String(e).length === 10 ? e * 1e3 : e), o = t(m, "HH:mm");
  return n.clone().local().hour(o.hour()).minute(o.minute()).second(0).add(1, "day").utc().format("YYYY-MM-DD HH:mm:ss");
}, H = (e, m = "00:00") => {
  const n = t(e * 1e3), o = t(m, "HH:mm");
  return n.clone().local().hour(o.hour()).minute(o.minute()).second(0).unix();
}, Y = (e, m = "00:00") => {
  const n = t(e * 1e3), o = t(m, "HH:mm"), c = n.clone().local().hour(o.hour()).minute(o.minute()).second(0).format();
  return t(c).isAfter(t());
};
export {
  i as isBackendDateAfterNow,
  Y as isDateTimePickerAfterNow,
  a as mapBackendDateToDateTimePicker,
  u as mapDateTimePickerToBackendDate,
  D as mapDateTimePickerToBackendDatePlusOneDay,
  H as mapDateTimePickerToUnix,
  s as mapToBackendDate
};
