Skip to content

Commit cabd03c

Browse files
authored
Merge branch 'main' into feat/408-waitlist-api
2 parents 898ebe6 + 9c4467f commit cabd03c

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

packages/web/src/views/Calendar/components/Sidebar/SomedayTab/MonthSection/MonthSection.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ export const MonthSection: FC<Props> = ({
2727
}) => {
2828
const monthLabel = getMonthListLabel(viewStart);
2929

30+
const currentMonth = new Date().toLocaleString("default", { month: "long" });
31+
32+
const isCurrentMonth = monthLabel === currentMonth;
33+
3034
return (
3135
<SidebarSection>
3236
<SidebarHeader
3337
alignItems={AlignItems.CENTER}
3438
justifyContent={JustifyContent.SPACE_BETWEEN}
3539
>
3640
<Text role="heading" size="xl">
37-
{monthLabel}
41+
{isCurrentMonth ? "This Month" : monthLabel}
3842
</Text>
3943
</SidebarHeader>
4044

packages/web/src/views/Calendar/components/Sidebar/SomedayTab/WeekSection/WeekSection.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,31 @@ export const WeekSection: FC<Props> = ({
2626
weekLabel,
2727
gridRefs,
2828
}) => {
29+
const isCurrentWeek = (label: String): boolean => {
30+
const [start, end] = label.split(" - ");
31+
const [month, startDay] = start.split(".").map(Number);
32+
const endDay = Number(end);
33+
const now = new Date();
34+
const year = now.getFullYear();
35+
36+
const startDate = new Date(year, month - 1, startDay);
37+
const endDate = new Date(year, month - 1, endDay);
38+
39+
now.setHours(0, 0, 0, 0);
40+
startDate.setHours(0, 0, 0, 0);
41+
endDate.setHours(0, 0, 0, 0);
42+
43+
return now >= startDate && now <= endDate;
44+
};
45+
2946
return (
3047
<SidebarSection>
3148
<SidebarHeader
3249
alignItems={AlignItems.CENTER}
3350
justifyContent={JustifyContent.SPACE_BETWEEN}
3451
>
3552
<Text role="heading" size="xl">
36-
{weekLabel}
53+
{isCurrentWeek(weekLabel) ? "This Week" : weekLabel}
3754
</Text>
3855
</SidebarHeader>
3956

packages/web/src/views/Forms/EventForm/SaveSection/SaveSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const SaveSection: React.FC<Props> = ({
4141
role="tab"
4242
tabIndex={0}
4343
title="Save event"
44-
onClick={_onSubmit}
4544
>
4645
Save
4746
</StyledSaveBtn>

0 commit comments

Comments
 (0)