mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-21 06:41:17 -04:00
use <time>
element for all dates
This commit is contained in:
15
components/Time/Time.tsx
Normal file
15
components/Time/Time.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { formatDateTZ, formatDateISO, FlexibleDate } from "../../lib/helpers/format-date";
|
||||
|
||||
export type TimeProps = {
|
||||
date: FlexibleDate;
|
||||
format?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Time = ({ date, format = "MMM d", className }: TimeProps) => (
|
||||
<time dateTime={formatDateISO(date)} title={formatDateTZ(date)} className={className}>
|
||||
{formatDateTZ(date, format)}
|
||||
</time>
|
||||
);
|
||||
|
||||
export default Time;
|
Reference in New Issue
Block a user