tal/calendarItemForLine

References

Referenced 1 time
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { calendarItemForLine } from "https://esm.town/v/tal/calendarItemForLine";
type Line = Parameters<typeof calendarItemForLine>[1];
type Context = Parameters<typeof calendarItemForLine>[0];
export async function buildDoeMenuCalendar(context: Context, storeValue) {
const ical = await import("npm:ical-generator");
let dailyOfferings: Line | undefined;
let events = [];
const calendar = ical.default({
name: `NYC DoE Lunch Menu ${context.menuType}`,
});
for (let line of storeValue.lines) {
if (line.date.type === "Daily Offerings") {
context.dailyOfferings = line;
}
let eventData = await calendarItemForLine(context, line);
if (eventData) {
events.push(eventData);
calendar.createEvent(eventData);
}
}
return calendar;
}
1
Next