import dayjs , { Dayjs } from 'dayjs' ; import { DateFormatEnum } from './DateFormatEnum' ; export const formatDate = ( date , includeTime = false , timezone ? ) => { const formatToUse = includeTime ? DateFormatEnum . DATE_FORMAT_INCLUDING_TIME : DateFormatEnum . DATE_FORMAT_MDY ; return dayjs ( date ) . tz ( timezone || dayjs . tz . guess ( ) ) . format ( formatToUse ) ; } ;