Skip to content

Commit 7211a8e

Browse files
committed
object destructuring for calendar week view
1 parent 27ea5a6 commit 7211a8e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ const CalendarWeekView: React.FC<CalendarWeekViewProps> = ({
178178

179179
// Format the week date range for the navigation header
180180
const formatWeekRange = (): string => {
181-
const start = weekDays[0];
182-
const end = weekDays[6];
181+
const [start, , , , , , end] = weekDays;
183182
const startStr = start.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
184183
if (start.getFullYear() !== end.getFullYear()) {
185184
return `${startStr}, ${start.getFullYear()}${end.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}`;

0 commit comments

Comments
 (0)