From bb6c8a03a731fea3f74b4dec0a8f03e421e5d832 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 5 May 2026 10:57:37 -0400 Subject: [PATCH] fix: calendar newlines, admin delivery window setting CalDAV: joins were using literal '\n' strings which icalEscape then double-escaped the backslash, so calendar entries showed raw \n. Now joins use real newline chars which icalEscape converts correctly. Added deliveryWindowMinutes to HoursConfig (default 60 min). The checkout route reads this at request time to set both the Square deliveryWindowDuration and the customer email arrival window. Admin hours page now has a number input to configure it. Co-Authored-By: Claude Sonnet 4.6 --- estore/src/app/admin/page.tsx | 20 ++++++++++++++++++++ estore/src/app/api/checkout/route.ts | 17 +++++++++-------- estore/src/lib/caldav.ts | 8 ++++---- estore/src/lib/hours-config.ts | 6 ++++-- estore/src/lib/hours.ts | 5 +++-- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/estore/src/app/admin/page.tsx b/estore/src/app/admin/page.tsx index 75859d6..e04a1f6 100644 --- a/estore/src/app/admin/page.tsx +++ b/estore/src/app/admin/page.tsx @@ -281,6 +281,26 @@ function HoursEditor() { ))} +
+ +

+ How long the customer's arrival window is — shown on their confirmation email and sent to Square. +

+ setConfig((prev) => prev ? { ...prev, deliveryWindowMinutes: Math.max(15, parseInt(e.target.value) || 60) } : prev)} + style={{ width: 100 }} + /> + min +
+