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/lib/utils/getDateRange.ts

15 lines
381 B

import moment from 'moment';
export const getDateRange = (): {
start: string;
end: string;
} => {
const today = moment(new Date());
const start = moment(new Date(today.year(), today.month(), today.date(), 0, 0, 0));
const end = moment(new Date(today.year(), today.month(), today.date(), 23, 59, 59));
return {
start: start.toISOString(),
end: end.toISOString(),
};
};