Skip to content

Commit

Permalink
add logic for tryMatchEvent to accomodate years
Browse files Browse the repository at this point in the history
  • Loading branch information
corwintines committed Nov 28, 2024
1 parent 1d1b92f commit f24ec0b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/scripts/events-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,21 @@ function tryMatchEvent(
imported: CommunityConference,
local: CommunityConference
) {
if (imported.title.toLocaleLowerCase() === local.title.toLocaleLowerCase())
if (
imported.title.toLocaleLowerCase() === local.title.toLocaleLowerCase() &&
local.startDate === imported.startDate &&
local.endDate === imported.endDate
)
return true

if (
URL.canParse(imported.href) &&
URL.canParse(local.href) &&
new URL(imported.href).hostname.replace("www.", "") ===
new URL(local.href).hostname.replace("www.", "") &&
new URL(imported.href).pathname === new URL(local.href).pathname
new URL(imported.href).pathname === new URL(local.href).pathname &&
local.startDate === imported.startDate &&
local.endDate === imported.endDate
) {
return true
}
Expand Down

0 comments on commit f24ec0b

Please sign in to comment.