Change date format to DD MMM. in blog listings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
393eb3f87e
commit
fcca5bb2ce
1 changed files with 4 additions and 3 deletions
|
|
@ -9,11 +9,12 @@ const { entry } = Astro.props as {
|
||||||
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">;
|
entry: CollectionEntry<"blog"> | CollectionEntry<"projects">;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Format date as DD/MM
|
// Format date as DD MMM.
|
||||||
const date = entry.data.date;
|
const date = entry.data.date;
|
||||||
const day = date.getDate().toString().padStart(2, '0');
|
const day = date.getDate().toString().padStart(2, '0');
|
||||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||||
const datePrefix = `${day}/${month}. `;
|
const month = monthNames[date.getMonth()];
|
||||||
|
const datePrefix = `${day} ${month}. `;
|
||||||
---
|
---
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue