@@ -97,9 +98,11 @@ export default function Page({ loaderData }: Route.ComponentProps) {
>
- Live tracking map
+ {isToday ? "Live tracking map" : "Map"}
- Follow along on the map
+ {isToday
+ ? "Follow along on the map"
+ : "See this day on the map"}
diff --git a/website/app/utils/dateTime.ts b/website/app/utils/dateTime.ts
index c255020..04e202a 100644
--- a/website/app/utils/dateTime.ts
+++ b/website/app/utils/dateTime.ts
@@ -66,6 +66,13 @@ export const formatDateTimeWithSeconds = (rawTimestamp: number) =>
*/
export const formatUtcDay = (dayString: string) => dayString;
+/** Today's UTC day bucket, in the same `YYYY-MM-DD` form as `events.date_string`. */
+export const todayUtcDay = () => DateTime.now().toUTC().toFormat("yyyy-MM-dd");
+
+/** Whether a `YYYY-MM-DD` UTC day bucket is today. */
+export const isTodayUtcDay = (dayString: string) =>
+ dayString === todayUtcDay();
+
/**
* A human duration between two stored timestamps, e.g. `2h 14m`, `47m`, `35s`.
*