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:
@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user