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.

final timezone fix please...for the love of god

Steven Teydd68fa0d7013
diff --git a/apps/web/lib/actions/partners/create-manual-commission.ts b/apps/web/lib/actions/partners/create-manual-commission.ts
index 239966a3a6..cb05d31af6 100644
--- a/apps/web/lib/actions/partners/create-manual-commission.ts
+++ b/apps/web/lib/actions/partners/create-manual-commission.ts
@@ -216,7 +216,7 @@ export const createManualCommissionAction = authActionClient
customerId: duplicateCustomerId,
eventId: leadEventData.event_id,
quantity: 1,
- createdAt: new Date(leadEventData.timestamp), // we don't add the "Z" to the timestamp because it's already in UTC
+ createdAt: new Date(leadEventData.timestamp + "Z"), // add the "Z" to the timestamp to make it UTC
user,
context: {
customer: { country: customer.country },
@@ -270,7 +270,7 @@ export const createManualCommissionAction = authActionClient
amount: saleEventData.amount,
currency: saleEventData.currency,
invoiceId: saleEventData.invoice_id,
- createdAt: new Date(saleEventData.timestamp), // we don't add the "Z" to the timestamp because it's already in UTC
+ createdAt: new Date(saleEventData.timestamp + "Z"), // add the "Z" to the timestamp to make it UTC
user,
context: {
customer: { country: customer.country },
@@ -366,7 +366,7 @@ export const createManualCommissionAction = authActionClient
customerId: customer.id,
eventId: leadEventData.event_id,
quantity: 1,
- createdAt: new Date(leadEventData.timestamp + "Z"),
+ createdAt: new Date(leadEventData.timestamp), // we don't add the "Z" to the timestamp because it's already in UTC
user,
context: {
customer: { country: customer.country },
@@ -405,7 +405,7 @@ export const createManualCommissionAction = authActionClient
amount: saleEventData.amount,
currency: saleEventData.currency,
invoiceId: saleEventData.invoice_id,
- createdAt: new Date(saleEventData.timestamp + "Z"),
+ createdAt: new Date(saleEventData.timestamp), // we don't add the "Z" to the timestamp because it's already in UTC
user,
context: {
customer: { country: customer.country },