import dayjs from 'dayjs';

export const datetimeStr = (date) =>{
    date = convertToDate(date);
    return dayjs(date).format("DD-MM-YYYY HH:mm:ss")
};

export const dateStr = (date) =>{
    date = convertToDate(date);
    return dayjs(date).format("DD-MM-YYYY")
};

const convertToDate = (date)=>{
    if(Array.isArray(date)){
        return new Date(date[0],date[1],date[2],date[3],date[4],date[5]);
    }
    return date;
}