Skip to content

Commit

Permalink
fix: Formatting of month category string was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorswanson committed Feb 11, 2024
1 parent c2d561e commit 2dd2a40
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions client/src/utils/convos.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import { parseISO, isToday, isWithinInterval, subDays, getMonth, getYear, startOfDay, startOfYear, format } from 'date-fns';
import {
parseISO,
isToday,
isWithinInterval,
subDays,
getMonth,
getYear,
startOfDay,
startOfYear,
format,
} from 'date-fns';
import type {
TConversation,
ConversationData,
Expand All @@ -21,7 +31,7 @@ const getGroupName = (date: Date) => {
return 'Previous 30 days';
}
if (isWithinInterval(date, { start: startOfYear(now), end: now })) {
return ' ' + format(getMonth(date), 'MMMM');
return ' ' + format(date, 'MMMM');
}
return ' ' + getYear(date).toString();
};
Expand Down

0 comments on commit 2dd2a40

Please sign in to comment.