Skip to content

Commit f24ec0b

Browse files
committed
add logic for tryMatchEvent to accomodate years
1 parent 1d1b92f commit f24ec0b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/scripts/events-import.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ function tryMatchEvent(
4848
imported: CommunityConference,
4949
local: CommunityConference
5050
) {
51-
if (imported.title.toLocaleLowerCase() === local.title.toLocaleLowerCase())
51+
if (
52+
imported.title.toLocaleLowerCase() === local.title.toLocaleLowerCase() &&
53+
local.startDate === imported.startDate &&
54+
local.endDate === imported.endDate
55+
)
5256
return true
5357

5458
if (
5559
URL.canParse(imported.href) &&
5660
URL.canParse(local.href) &&
5761
new URL(imported.href).hostname.replace("www.", "") ===
5862
new URL(local.href).hostname.replace("www.", "") &&
59-
new URL(imported.href).pathname === new URL(local.href).pathname
63+
new URL(imported.href).pathname === new URL(local.href).pathname &&
64+
local.startDate === imported.startDate &&
65+
local.endDate === imported.endDate
6066
) {
6167
return true
6268
}

0 commit comments

Comments
 (0)