dependabot/npm_and_yarn/astrojs/mdx-7.0.8
dependabot/npm_and_yarn/astro-7.4.0
dependabot/npm_and_yarn/astrojs/mdx-7.0.8
dependabot/npm_and_yarn/astrojs/sitemap-3.7.4
dependabot/npm_and_yarn/katex-0.19.0
dependabot/npm_and_yarn/prettier-3.9.10
dependabot/npm_and_yarn/sharp-0.35.5
dependabot/npm_and_yarn/tsx-4.23.15
dependabot/npm_and_yarn/typescript-eslint-8.71.2
dependabot/npm_and_yarn/typescript-eslint/parser-8.71.2
development
main
| 1 | --- |
| 2 | import { formatDate } from '@/utils/date' |
| 3 | import { SITE } from '@/config' |
| 4 | |
| 5 | interface Props { |
| 6 | date: Date |
| 7 | format?: string |
| 8 | } |
| 9 | |
| 10 | const { date, format } = Astro.props |
| 11 | --- |
| 12 | |
| 13 | <time |
| 14 | datetime={date.toISOString()} |
| 15 | class={!SITE.dateOnRight && |
| 16 | (SITE.dateFormat === 'MONTH DAY YYYY' || SITE.dateFormat === 'DAY MONTH YYYY') |
| 17 | ? 'date-left' |
| 18 | : ''} |
| 19 | > |
| 20 | <Fragment set:html={formatDate(date, format)} /> |
| 21 | </time> |
| 22 | |
| 23 | <style> |
| 24 | .date-left { |
| 25 | display: inline-block; |
| 26 | min-width: 86px; |
| 27 | text-align: right; |
| 28 | } |
| 29 | </style> |