import dayjs from 'dayjs'; export const formatDate = (date: string, format: string) => { return dayjs(date).format(format); }; export const checkFormatedDate = (date: string, dateFormat: string) => { if (date && dateFormat === 'DD/MM/YYYY' && !dateFormat.includes('-')) { const splittedDate = date.split('/'); return `${splittedDate[2]}-${splittedDate[1]}-${splittedDate[0]}`; } return date; };