Skip to content

Commit

Permalink
feat: set the PRODID ICS value
Browse files Browse the repository at this point in the history
  • Loading branch information
vfurmane committed May 16, 2024
1 parent 5d7dd3a commit e723a4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/common/constants/calendars-name.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const CALENDAR_NAME_ALL_EVENTS = 'All events at 42';

export const CALENDARS_PRODID = '-//VALFUR//42CAL 42SCHOOL EVENTS';
3 changes: 2 additions & 1 deletion src/common/utils/create-ical-from-events.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ical, { ICalCalendarData } from 'ical-generator';
import { FindEventsResponseDto } from '../../ft-api/dto/find-events-response.dto';
import { CALENDARS_PRODID } from '../constants/calendars-name';

export function createIcalFromEvents(config: ICalCalendarData) {
return (events: FindEventsResponseDto) => {
const calendar = ical(config);
const calendar = ical({ prodId: CALENDARS_PRODID, ...config });
events.forEach(({ begin_at, end_at, name, description, location }) => {
calendar.createEvent({
start: begin_at,
Expand Down

0 comments on commit e723a4d

Please sign in to comment.