split in env required and dynamic values
This commit is contained in:
parent
f32143b7ac
commit
730c25a9a1
35 changed files with 491 additions and 198 deletions
|
@ -1,7 +1,7 @@
|
|||
import { createEvents } from "ics";
|
||||
import { calendar } from "../entity/club/calendar";
|
||||
import moment from "moment";
|
||||
import { CLUB_NAME, CLUB_WEBSITE, MAIL_USERNAME } from "../env.defaults";
|
||||
import SettingHelper from "./settingsHelper";
|
||||
|
||||
export abstract class CalendarHelper {
|
||||
public static buildICS(entries: Array<calendar>): { error?: Error; value?: string } {
|
||||
|
@ -35,7 +35,10 @@ export abstract class CalendarHelper {
|
|||
description: i.content,
|
||||
location: i.location,
|
||||
categories: [i.type.type],
|
||||
organizer: { name: CLUB_NAME, email: MAIL_USERNAME },
|
||||
organizer: {
|
||||
name: SettingHelper.getSetting("club.name") as string,
|
||||
email: SettingHelper.getSetting("mail.username") as string,
|
||||
},
|
||||
created: moment(i.createdAt)
|
||||
.format("YYYY-M-D-H-m")
|
||||
.split("-")
|
||||
|
@ -46,7 +49,9 @@ export abstract class CalendarHelper {
|
|||
.map((a) => parseInt(a)) as [number, number, number, number, number],
|
||||
transp: "OPAQUE" as "OPAQUE",
|
||||
status: "CONFIRMED",
|
||||
...(CLUB_WEBSITE != "" ? { url: CLUB_WEBSITE } : {}),
|
||||
...(SettingHelper.getSetting("club.website") != ""
|
||||
? { url: SettingHelper.getSetting("club.website") as string }
|
||||
: {}),
|
||||
alarms: [
|
||||
{
|
||||
action: "display",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue