mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
enrich description in calendar
This commit is contained in:
@@ -2,6 +2,7 @@ import { createEvents, EventStatus } from 'ics'
|
||||
import { Booking } from '../db/booking'
|
||||
import { BOOKING_STATUS } from '../db/enums'
|
||||
import { getBaseURL } from './url'
|
||||
import { daysFormatFrontend } from './date'
|
||||
|
||||
function convertDay(value: string): [number, number, number] {
|
||||
const parts = value.split('-')
|
||||
@@ -17,7 +18,14 @@ export function generateBookedCalendar(bookings: Booking[]) {
|
||||
start: convertDay(booking.days[0]),
|
||||
end: convertDay(booking.days[booking.days.length - 1]),
|
||||
title: `Buchung ${booking.booker.name}`,
|
||||
description: `Link: ${getBaseURL()}/admin/booking/${booking.uuid}`,
|
||||
description: `Name: ${booking.booker.name}
|
||||
Zeitraum: ${daysFormatFrontend(booking.days)}
|
||||
|
||||
Email: ${booking.booker.email}
|
||||
Telefon: ${booking.booker.phone}
|
||||
|
||||
Link: ${getBaseURL()}/admin/booking/${booking.uuid}
|
||||
`,
|
||||
status:
|
||||
booking.status === BOOKING_STATUS.CONFIRMED
|
||||
? ('CONFIRMED' as EventStatus)
|
||||
|
||||
Reference in New Issue
Block a user