14 lines
289 B
Plaintext
14 lines
289 B
Plaintext
---
|
|
interface Props {
|
|
timestamp: Date;
|
|
format?: string | undefined;
|
|
}
|
|
|
|
const { timestamp, format: customFormat } = Astro.props;
|
|
import { format } from "date-fns";
|
|
---
|
|
|
|
<span class="timestamp" title={timestamp.toISOString()}>
|
|
{format(timestamp, customFormat ?? "yyyy MMM d")}
|
|
</span>
|