The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/lib/utils/formatDate.ts

13 lines
393 B

import mem from 'mem';
import { Tracker } from 'meteor/tracker';
import moment, { MomentInput } from 'moment';
import { settings } from '../../../app/settings/client';
export const formatDate = mem(
(time: MomentInput) => {
const messageDateFormat = Tracker.nonreactive(() => settings.get('Message_DateFormat'));
return moment(time).format(messageDateFormat);
},
{ maxAge: 5000 },
);