Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix timezone

Steven Teyb50aebcc379f
diff --git a/apps/web/lib/actions/partners/create-manual-payout.ts b/apps/web/lib/actions/partners/create-manual-payout.ts
index 47704bd65e..c994414417 100644
--- a/apps/web/lib/actions/partners/create-manual-payout.ts
+++ b/apps/web/lib/actions/partners/create-manual-payout.ts
@@ -71,6 +71,7 @@ export const createManualPayoutAction = authActionClient
partnerId,
periodStart: start!,
periodEnd: end!,
+ description: description ?? undefined,
});
}
diff --git a/apps/web/lib/partners/create-sales-payout.ts b/apps/web/lib/partners/create-sales-payout.ts
index 8bc3aedf48..3e1af13654 100644
--- a/apps/web/lib/partners/create-sales-payout.ts
+++ b/apps/web/lib/partners/create-sales-payout.ts
@@ -7,11 +7,13 @@ export const createSalesPayout = async ({
partnerId,
periodStart,
periodEnd,
+ description,
}: {
programId: string;
partnerId: string;
periodStart: Date;
periodEnd: Date;
+ description?: string;
}) => {
return await prisma.$transaction(async (tx) => {
const sales = await tx.sale.findMany({
@@ -59,6 +61,7 @@ export const createSalesPayout = async ({
periodStart,
periodEnd,
quantity: sales.length,
+ description,
},
});
diff --git a/apps/web/ui/partners/create-payout-sheet.tsx b/apps/web/ui/partners/create-payout-sheet.tsx
index 406af372ab..309265e6f2 100644
--- a/apps/web/ui/partners/create-payout-sheet.tsx
+++ b/apps/web/ui/partners/create-payout-sheet.tsx
@@ -291,7 +291,8 @@ function CreatePayoutSheetContent({ setIsOpen }: CreatePayoutSheetProps) {
new Date(start).getFullYear() === new Date(end).getFullYear()
? undefined
: "numeric",
- })}-${formatDate(end, { month: "short" })}`,
+ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
+ })}-${formatDate(end, { month: "short", timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })}`,
}),
...(payoutType !== "custom" && {