UNPKG

react-native-gifted-chat-video-support

Version:

The most complete chat UI for React Native , now support send video thanks to react-native-video-player

21 lines (15 loc) 592 B
import moment from 'moment'; export function isSameDay(currentMessage = {}, diffMessage = {}) { if (!diffMessage.createdAt) { return false; } const currentCreatedAt = moment(currentMessage.createdAt); const diffCreatedAt = moment(diffMessage.createdAt); if (!currentCreatedAt.isValid() || !diffCreatedAt.isValid()) { return false; } return currentCreatedAt.isSame(diffCreatedAt, 'day'); } export function isSameUser(currentMessage = {}, diffMessage = {}) { return !!(diffMessage.user && currentMessage.user && diffMessage.user._id === currentMessage.user._id); }