--- import type { ComWhtwndBlogEntryRecord } from '../../lib/generated/com-whtwnd-blog-entry'; import { marked } from 'marked'; interface Props { record: ComWhtwndBlogEntryRecord; showTags?: boolean; showTimestamp?: boolean; } const { record, showTags = true, showTimestamp = true } = Astro.props; const formatDate = (dateString: string) => { return new Date(dateString).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', }); }; const published = record.createdAt; const isValidDate = published ? !isNaN(new Date(published).getTime()) : false; ---

{record.title}

{showTimestamp && isValidDate && (
Published on {formatDate(published!)}
)}