
* Init dev * UI changes for recurring event + prisma * Revisiting schema + changes WIP * UI done, BE WIP * Feature completion * Unused query param removed * Invalid comment removed * Removed unused translation * Update apps/web/public/static/locales/en/common.json Thanks! Co-authored-by: Peer Richelsen <peeroke@gmail.com> * Success page changes * More progress * Email text tweaks + test + seed * Tweaking emails + Cal Apps support WIP * No app integration for now Final email and pages tweaks to avoid recurring info showed * Missing comment for clarity * Yet again, comment * Last minute fix * Missing tooltip for upcoming bookings * Fixing seed * Fixing import * Increasing timeout for e2e * Fixing any * Apply suggestions from code review Co-authored-by: Omar López <zomars@me.com> * Update apps/web/pages/d/[link]/book.tsx Co-authored-by: Omar López <zomars@me.com> * Code improvements * More code improvements * Reverting back number input arrows * Update BookingPage.tsx * Update BookingPage.tsx * Adds fallback for sendOrganizerPaymentRefundFailedEmail * Type overkill * Type fixes * Type fixes * Nitpicks * Update success.tsx * Update success.tsx * Update success.tsx * Fixing types Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Omar López <zomars@me.com>
27 lines
927 B
TypeScript
27 lines
927 B
TypeScript
import { Frequency as RRuleFrequency } from "rrule";
|
|
import { z } from "zod";
|
|
|
|
import { LocationType } from "@calcom/core/location";
|
|
import { slugify } from "@calcom/lib/slugify";
|
|
|
|
export const eventTypeLocations = z.array(
|
|
z.object({
|
|
type: z.nativeEnum(LocationType),
|
|
address: z.string().optional(),
|
|
link: z.string().url().optional(),
|
|
})
|
|
);
|
|
|
|
// Matching RRule.Options: rrule/dist/esm/src/types.d.ts
|
|
export const recurringEvent = z.object({
|
|
dtstart: z.date().optional(),
|
|
interval: z.number().optional(),
|
|
count: z.number().optional(),
|
|
freq: z.nativeEnum(RRuleFrequency).optional(),
|
|
until: z.date().optional(),
|
|
tzid: z.string().optional(),
|
|
});
|
|
|
|
export const eventTypeSlug = z.string().transform((val) => slugify(val.trim()));
|
|
export const stringToDate = z.string().transform((a) => new Date(a));
|
|
export const stringOrNumber = z.union([z.string().transform((v) => parseInt(v, 10)), z.number().int()]);
|