modified UI and activity log in website (#4935)

-Small fixes in UI 
-Added extra columns in contributor activity log when necessary (ex: few
contributions):

**Before:** 

<img width="809" alt="Screenshot 2024-04-11 at 20 37 40"
src="https://github.com/twentyhq/twenty/assets/102751374/d58cebe5-4128-43bb-a649-3c9ac0276c53">

**After:** 

<img width="897" alt="Screenshot 2024-04-11 at 20 37 53"
src="https://github.com/twentyhq/twenty/assets/102751374/7e112f8f-b257-4397-96fa-79e605daab37">

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
This commit is contained in:
Ady Beraud
2024-04-12 10:15:23 +02:00
committed by GitHub
parent 743c3c2c17
commit b42a892c7b
4 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,22 @@
const TOTAL_DAYS_TO_FULL_WIDTH = 232;
export const getActivityEndDate = (
activityDates: { value: number; day: string }[],
) => {
const startDate = new Date(activityDates[0].day);
const endDate = new Date(activityDates[activityDates.length - 1].day);
const differenceInMilliseconds = endDate.getTime() - startDate.getTime();
const numberOfDays = Math.floor(
differenceInMilliseconds / (1000 * 60 * 60 * 24),
);
const daysToAdd = TOTAL_DAYS_TO_FULL_WIDTH - numberOfDays;
if (daysToAdd > 0) {
endDate.setDate(endDate.getDate() + daysToAdd);
}
return endDate;
};