import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
export const formatDate = (date) => {
    if (date) {
        return dayjs(new Date(date)).format('DD-MM-YYYY HH:MM');
    }
    return '';
};
export const getDate = (date) => {
    if (date) {
        return dayjs(new Date(date)).format('DD-MM-YYYY');
    }
    return '';
};
export const getDay = (date) => {
    if (date) {
        return dayjs(new Date(date)).format('DD');
    }
    return '';
};
export const getRestOfDate = (date) => {
    if (date) {
        return dayjs(new Date(date)).format('MM-YYYY');
    }
    return '';
};
export const getTime = (date) => {
    if (date) {
        dayjs.extend(utc);
        return dayjs.utc(new Date(date)).local().format('HH:mm');
    }
    return '';
};
export const addTimezone = (date) => date.endsWith('Z') ? date : `${date}Z`;
export const getDifference = (to, from) => dayjs(to).diff(dayjs(from), 'days');
//# sourceMappingURL=dates.js.map