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/ee/app/auditing/client/utils.js

22 lines
564 B

export { callWithErrorHandling as call } from '../../../../client/lib/utils/callWithErrorHandling';
export const convertDate = (date) => {
const [y, m, d] = date.split('-');
return new Date(y, m - 1, d);
};
export const scrollTo = function scrollTo(element, to, duration) {
if (duration <= 0) {
return;
}
const difference = to - element.scrollTop;
const perTick = (difference / duration) * 10;
setTimeout(function () {
element.scrollTop += perTick;
if (element.scrollTop === to) {
return;
}
scrollTo(element, to, duration - 10);
}, 10);
};