Skip to content

Commit

Permalink
Merge pull request #67 from CaritasDeutschland/OBI-1202
Browse files Browse the repository at this point in the history
fix: [OBI-1202] fix feedback chat date
  • Loading branch information
web-mi authored Nov 9, 2022
2 parents 4e4ccdb + 886a70b commit beba0d2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/message/MessageDisplayName.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { isUserModerator } from '../session/sessionHelpers';
import * as React from 'react';
import { useCallback, useContext } from 'react';
import { getPrettyDateFromMessageDate } from '../../utils/dateHelpers';
import {
formatToHHMM,
getPrettyDateFromMessageDate
} from '../../utils/dateHelpers';
import { ReactComponent as ArrowForwardIcon } from '../../resources/img/icons/arrow-forward.svg';
import { ForwardMessageDTO } from './MessageItemComponent';
import { ActiveSessionContext } from '../../globalState/provider/ActiveSessionProvider';
Expand Down Expand Up @@ -38,16 +41,15 @@ export const MessageDisplayName = ({
const prettyDate = getPrettyDateFromMessageDate(
Math.round(alias.timestamp / 1000)
);
const translatedDate = prettyDate.str
? translate(prettyDate.str)
: translate(prettyDate.date);

return translate('message.forward.label', {
username: alias?.username,
translatedDate,
time: alias?.timestamp
date: prettyDate.str
? translate(prettyDate.str)
: translate(prettyDate.date),
time: alias.timestamp && formatToHHMM(alias.timestamp)
});
}, [alias?.timestamp, alias?.username, translate]);
}, [alias, translate]);

const subscriberIsModerator = isUserModerator({
chatItem: activeSession.item,
Expand Down

0 comments on commit beba0d2

Please sign in to comment.