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/hooks/useFormatDate.js

9 lines
286 B

import { useCallback } from 'react';
import moment from 'moment';
import { useSetting } from '../contexts/SettingsContext';
export const useFormatDate = () => {
const format = useSetting('Message_DateFormat');
return useCallback((time) => moment(time).format(format), [format]);
};