Skip to content

Commit f62b3c9

Browse files
authored
Fixed meetup time changed alert (#319)
1 parent 7ae672c commit f62b3c9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/server/trpc/router/gig.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const sendChangedGigMeetupAlert = async (newGig: Gig, oldGig: Gig) => {
9292

9393
const info = [];
9494

95-
const isDateChanged = oldGig.date !== newGig.date;
95+
const isDateChanged = oldGig.date.getTime() !== newGig.date.getTime();
9696

9797
const displayTime = (gig: Gig, lang: 'sv' | 'en') => {
9898
if (!gig.meetup) {
@@ -101,7 +101,7 @@ const sendChangedGigMeetupAlert = async (newGig: Gig, oldGig: Gig) => {
101101
return (
102102
gig.meetup.trim() +
103103
(isDateChanged
104-
? ' ' +
104+
? (lang === 'sv' ? ' den ' : ' ') +
105105
gig.date.toLocaleDateString(
106106
lang,
107107
lang === 'en'
@@ -114,17 +114,17 @@ const sendChangedGigMeetupAlert = async (newGig: Gig, oldGig: Gig) => {
114114

115115
info.push(`# Tidsändring för ${oldGig.title.trim()}`);
116116
info.push(
117-
`*Samlingstiden för ${oldGig.title.trim()} har flyttats från ${displayTime(
117+
`Samlingstiden för ${oldGig.title.trim()} har flyttats från ${displayTime(
118118
oldGig,
119119
'sv',
120-
)} till ${displayTime(newGig, 'sv')}.*`,
120+
)} till ${displayTime(newGig, 'sv')}.`,
121121
);
122122
info.push(``);
123123
info.push(
124-
`*The gathering time for ${oldGig.title.trim()} has been moved from ${displayTime(
124+
`The gathering time for ${oldGig.title.trim()} has been moved from ${displayTime(
125125
oldGig,
126126
'en',
127-
)} to ${displayTime(newGig, 'en')}.*`,
127+
)} to ${displayTime(newGig, 'en')}.`,
128128
);
129129
await sendDiscordAlert(info.join('\n'));
130130
};

0 commit comments

Comments
 (0)