Skip to content

Commit a471f61

Browse files
committed
Simplify date conversion
1 parent 55a6100 commit a471f61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ X-PUBLISHED-TTL:PT1H
198198
const titleFormatted = `${AssignmentCodeDescription[item.assignmentCode]} ${
199199
item.activity.name
200200
}`;
201-
const startDate = new Date(item.activity.startTime);
202-
const endDate = new Date(item.activity.endTime);
201+
const startDate = icsFormatDate(new Date(item.activity.startTime));
202+
const endDate = icsFormatDate(new Date(item.activity.endTime));
203203

204204
console.log(wcif.schedule);
205205

@@ -216,8 +216,8 @@ DTSTAMP:${icsFormatDate(new Date())}
216216
SUMMARY:${titleFormatted}
217217
DESCRIPTION:${item.activity.name}
218218
LOCATION:${item.activity.parent.room.name}
219-
DTSTART:${icsFormatDate(startDate)}
220-
DTEND:${icsFormatDate(endDate)}
219+
DTSTART:${startDate}
220+
DTEND:${endDate}
221221
${location}END:VEVENT
222222
BEGIN:VALARM
223223
TRIGGER:-PT5M

0 commit comments

Comments
 (0)