Something went wrong. Try again.
Fork of Chiri for Astro for my blog forked from quillmatiq.com/augment
Something went wrong. Try again.
677 B · 30 lines
Astro
at main
12345678910111213141516171819202122232425262728293031---import { themeConfig } from '@/config'import { formatDate } from '@/utils/date'import type { FormattedDateProps } from '@/types'
const { date, format, context = 'default'} = Astro.props as FormattedDateProps & { context?: 'list' | 'post' | 'default' }---
<time datetime={date.toISOString()} class={!themeConfig.date.dateOnRight && (themeConfig.date.dateFormat === 'MONTH DAY YYYY' || themeConfig.date.dateFormat === 'DAY MONTH YYYY') && context === 'list' ? 'date-left' : ''}> <Fragment set:html={formatDate(date, format)} /></time>
<style> .date-left { display: inline-block; min-width: 86px; text-align: right; }</style>