import { format, isSameDay } from 'date-fns'; const parseDate = (date: Date) => { return new Date(date); }; export const getMessageDateTime = (dateTime: Date) => { return format(parseDate(dateTime), 'hh:mm a'); }; export const getMessageDividerDateTime = (dateTime: Date) => { return format(parseDate(dateTime), 'MMMM dd'); }; export const isDateSame = (current: Date, next: Date) => { return isSameDay(parseDate(current), parseDate(next)); }; export const getCurrentEpoch = () => Math.floor(new Date().getTime() / 1000.0); export const getEpochAddedMinutes = (epoch: number, minutes: number) => epoch + minutes * 60;