mhunt_account_dash/components/formatted-date.tsx
2024-07-29 13:17:10 +05:30

15 lines
320 B
TypeScript

type Props = {
secsSinceEpoch: number;
};
export default function FormattedDate({secsSinceEpoch}: Props) {
const formattedDate = new Date(secsSinceEpoch * 1000).toLocaleDateString('en-us', {
weekday: 'long',
year: 'numeric',
month: 'short',
day: 'numeric',
});
return <p>{formattedDate}</p>;
}