Просмотр исходного кода

Improve naming in date util function

arvid-e 5 месяцев назад
Родитель
Сommit
673610828c

+ 4 - 4
apps/app/src/features/contribution-graph/utils/contribution-graph-utils.ts

@@ -7,11 +7,11 @@ export const getISOWeekId = (date: Date): string => {
   return format(date, "RRRR-'W'II");
 };
 
-export const daysSinceLastUpdate = (
-  lastUpdateDate: Date,
-  currentDate: Date = new Date(),
+export const getDaysDifference = (
+    dateFrom: Date,
+    dateTo: Date = new Date(),
 ): number => {
-  const diffDays = differenceInDays(lastUpdateDate, currentDate);
+  const diffDays = differenceInDays(dateFrom, dateTo);
   return Math.max(0, diffDays);
 };