import './chunk-NYLAFCGV.mjs';
import dayjs from 'dayjs';
export { default as dayjs } from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime.js';
import timezone from 'dayjs/plugin/timezone.js';
import utc from 'dayjs/plugin/utc.js';

dayjs.extend(utc);
dayjs.extend(relativeTime);
dayjs.extend(timezone);
var timeZone = dayjs.tz.guess();
dayjs.tz.setDefault(timeZone);
function formatDate(date, format = "DD/MM/YYYY") {
  return dayjs(date).format(format);
}
function formatDateToNow(date) {
  return dayjs(date).fromNow();
}
function parseUnix(time) {
  return dayjs.unix(time);
}
function getUnixTime(date) {
  return dayjs(date).unix();
}
function formatDateUnixTime(seconds, format = "DD/MM/YYYY") {
  return formatDate(dayjs.unix(seconds).toISOString(), format);
}
function diffDate(toDate, fromDate, config) {
  const formattedToDate = dayjs(toDate).format("YYYY-MM-DD");
  const formattedFromDate = dayjs(fromDate).format("YYYY-MM-DD");
  return dayjs(formattedFromDate).diff(dayjs(formattedToDate), config?.unit, config?.float);
}
function addNewDate(date, addDays = 0) {
  return dayjs(date).add(addDays, "day").toDate();
}

export { addNewDate, diffDate, formatDate, formatDateToNow, formatDateUnixTime, getUnixTime, parseUnix };
