+ {ticket.time.startTime ? (
+ <>
+ {fmtDate(new Date(ticket.time.startDate))}
+
+ {ticket.time.startTime &&
+ ` at ${fmtTime(new Date(ticket.time.startTime))}`}
+
+ >
+ ) : (
+
+ )}
+
-
{ticket.event.name}
-
{ticket.event.summary}
+
+ {ticket.event.name}
+
+
+ {ticket.event.summary}
+
View Ticket
diff --git a/utils/dates.ts b/utils/dates.ts
index 48a0eb3..528ecb1 100644
--- a/utils/dates.ts
+++ b/utils/dates.ts
@@ -34,4 +34,7 @@ export const fmtHour = (date: Date) => hourFmt.format(date);
export const fmtTime = (date: Date) => timeFmt.format(date);
// not an ideal solution
export const getTimeZone = (date: Date) =>
- date.toString().split("(")[1].slice(undefined, date.toString().split("(")[1].length - 1);
+ date
+ .toString()
+ .split("(")[1]
+ .slice(undefined, date.toString().split("(")[1].length - 1);
diff --git a/utils/db/kv.types.ts b/utils/db/kv.types.ts
index a4441e6..4a879c2 100644
--- a/utils/db/kv.types.ts
+++ b/utils/db/kv.types.ts
@@ -30,6 +30,7 @@ export interface Event {
published: boolean;
}
+// known to users as Event Times
export interface ShowTime {
startDate: string;
startTime?: string;
diff --git a/utils/event/fixDate.ts b/utils/event/fixDate.ts
index db1b3df..02e3f8c 100644
--- a/utils/event/fixDate.ts
+++ b/utils/event/fixDate.ts
@@ -1,21 +1,22 @@
import { ShowTime } from "@/utils/db/kv.ts";
-export const fixDate = (showTimes: ShowTime[]) => showTimes.map((showTime) => {
- if (!showTime.startTime) return showTime;
- const date = new Date(showTime.startDate);
- const time = new Date(showTime.startTime);
+export const fixDate = (showTimes: ShowTime[]) =>
+ showTimes.map((showTime) => {
+ if (!showTime.startTime) return showTime;
+ const date = new Date(showTime.startDate);
+ const time = new Date(showTime.startTime);
- if (time) {
- date.setHours(time.getHours());
- date.setMinutes(time.getMinutes());
- } else {
- // remove the hours and just display as normal if user doesn't add a start date
- date.setHours(0);
- date.setMinutes(0);
- }
+ if (time) {
+ date.setHours(time.getHours());
+ date.setMinutes(time.getMinutes());
+ } else {
+ // remove the hours and just display as normal if user doesn't add a start date
+ date.setHours(0);
+ date.setMinutes(0);
+ }
- return {
- ...showTime,
- startDate: date.toString(),
- };
-})
\ No newline at end of file
+ return {
+ ...showTime,
+ startDate: date.toString(),
+ };
+ });
diff --git a/utils/imagekit/URL.ts b/utils/imagekit/URL.ts
index 87cf86a..3c1b2aa 100644
--- a/utils/imagekit/URL.ts
+++ b/utils/imagekit/URL.ts
@@ -1,15 +1,15 @@
import imagekit from "@/utils/imagekit/index.ts";
export const getURL = (width: number, path: string) =>
-["png", "webp"].map((fmt) =>
- imagekit!.url({
- path,
- transformation: [
- {
- width: width.toString(),
- quality: "85",
- format: fmt,
- },
- ],
- }),
-);
+ ["png", "webp"].map((fmt) =>
+ imagekit!.url({
+ path,
+ transformation: [
+ {
+ width: width.toString(),
+ quality: "85",
+ format: fmt,
+ },
+ ],
+ }),
+ );