mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-18 16:05:33 -04:00
clean up remaining NEXT_PUBLIC_ environment variables
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { env } from "../../lib/env";
|
||||
import { format, formatISO } from "date-fns";
|
||||
import { enUS } from "date-fns/locale";
|
||||
import { tz } from "@date-fns/tz";
|
||||
import { utc } from "@date-fns/utc";
|
||||
import { SITE_TZ } from "../../lib/config/constants";
|
||||
import type { ComponentPropsWithoutRef } from "react";
|
||||
|
||||
export type TimeProps = ComponentPropsWithoutRef<"time"> & {
|
||||
@@ -14,10 +14,10 @@ const Time = ({ date, format: formatStr = "PPpp", ...rest }: TimeProps) => {
|
||||
return (
|
||||
<time
|
||||
dateTime={formatISO(date, { in: utc })}
|
||||
title={format(date, "MMM d, y, h:mm a O", { in: tz(SITE_TZ), locale: enUS })}
|
||||
title={format(date, "MMM d, y, h:mm a O", { in: tz(env.NEXT_PUBLIC_SITE_TZ), locale: enUS })}
|
||||
{...rest}
|
||||
>
|
||||
{format(date, formatStr, { in: tz(SITE_TZ), locale: enUS })}
|
||||
{format(date, formatStr, { in: tz(env.NEXT_PUBLIC_SITE_TZ), locale: enUS })}
|
||||
</time>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user