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/apps/meteor/client/hooks/useFormatDate.ts

8 lines
334 B

import { useSetting } from '@rocket.chat/ui-contexts';
import moment from 'moment';
import { useCallback } from 'react';
export const useFormatDate = (): ((time: string | Date | number) => string) => {
const format = useSetting('Message_DateFormat');
return useCallback((time) => moment(time).format(String(format)), [format]);
};